Solved

perl

Posted on 2011-09-29
5
403 Views
Last Modified: 2012-05-12

eval dat="$"${nf}_sw_py_th

if [ x$dat != "x" ]

what is the meaning of above statement in perl ?
0
Comment
Question by:damodar4u
  • 3
  • 2
5 Comments
 

Author Comment

by:damodar4u
ID: 36819072
in that case nf is
nf="tato-matty"
0
 
LVL 31

Accepted Solution

by:
farzanj earned 500 total points
ID: 36819077
Are you sure this is in Perl.  It appears to be Bash (shell scripting).

The if statement is especially in Bash/Ksh.

If statement will be successful (true) if the value of $dat variable is not null.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 36819105
In the first statement, you are trying to form a variable name run time and trying to get the value of that variable.

So

The value of

$tato-matty_sw_py_th

This should be
tato_matty
0
 

Author Comment

by:damodar4u
ID: 36819130
sorry this is not perl... this is shell scripting
0
 
LVL 31

Expert Comment

by:farzanj
ID: 36819143
Yes, I know.  I hope the above answers are making sense.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question