Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Help need in Miscellaneous code

by liverpole (Monsignor)
on Oct 06, 2006 at 13:04 UTC ( [id://576656]=note: print w/replies, xml ) Need Help??


in reply to Help need in Miscellaneous code

Originally posted here, on July 19, 2005, with the title "Is this a perl bug?", and signed by someone named "Ted":
Why does the following program print "Undefined!"? Shouldn't the subro +utine leave the value of $x alone? (I can understand it clobbering $_, but $ +x?) #!/usr/bin/perl -w use strict; sub readZip() { open FH, '/dev/null'; while (<FH>) { print "Got something!\n"; } } my $x = 'hi'; for ($x) { readZip(); } print "Undefined!\n" unless defined $x; (I'm using perl 5.6.1)

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-23 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found