Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: What is wrong with variable?

by insaniac (Friar)
on Mar 19, 2006 at 08:41 UTC ( [id://537731]=note: print w/replies, xml ) Need Help??


in reply to Re: What is wrong with variable?
in thread What is wrong with variable?

so the posted code works?
my $last, $now)= '0';
What is this supposed to do? Initialize both $last and $now to '0'? Guess again...
my $last = my $now = '0';
works better ;-)

btw, what is this supposed to do:

system(`$1`); return $now; print "I done $1"; last
The last two lines will never get executed... never! BTW: why do you use backticks in your system() sub? It's either `$1`, or do{ open(my $cmdh, '-|', $1); <$cmdh> } or system($1)... but combining two of them is probably not what you want to do...
and... you might wanna write those 4 lines in a different order:
`$1`; print qq{I've done $1}; return $now
3 lines... does the same thing ;)

cya!

to ask a question is a moment of shame
to remain ignorant is a lifelong shame

Replies are listed 'Best First'.
Re^3: What is wrong with variable?
by w3b (Beadle) on Mar 19, 2006 at 09:33 UTC
    I wrote bad version of script... now i see.... I'll copy good version today... sorry

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://537731]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-23 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found