Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: non-global $/

by Jenda (Abbot)
on Jun 22, 2005 at 15:33 UTC ( [id://469058]=note: print w/replies, xml ) Need Help??


in reply to Re: non-global $/
in thread non-global $/

Nope. my() doesn't care about packages.

use strict; my $x = 5; print "\$x in main package=$x\n"; package other; print "\$x in other package=$x\n";

Jenda
XML sucks. Badly. SOAP on the other hand is the most powerfull vacuum pump ever invented.

Replies are listed 'Best First'.
Re^3: non-global $/
by Ultra (Hermit) on Jun 23, 2005 at 06:43 UTC
    Indeed, but in his context, my would be more suited.

    Update: Thanks monkey_boy for pointing me that Can't use global $/ in "my"
    Dodge This!

      my $/ = 'Foo';

      Wont compile:
      Can't use global $/ in "my"


      This is not a Signature...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-19 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found