Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Global vars not accessable globaly

by theroninwins (Friar)
on Sep 20, 2004 at 09:11 UTC ( #392308=note: print w/replies, xml ) Need Help??


in reply to Re: Global vars not accessable globaly
in thread Global vars not accessable globaly

Nice example but doesn't really help a bit more plain text would be better. and what is a think-o?
Oh and the content of final1 in that statement is correct. When i print it there it works just fine.
  • Comment on Re^2: Global vars not accessable globaly

Replies are listed 'Best First'.
Re^3: Global vars not accessable globaly
by PodMaster (Abbot) on Sep 20, 2004 at 09:33 UTC
    Nice example but doesn't really help a bit more plain text would be better
    Can you answer why @foo1 doesn't contain 666 and 123?

    In your original question you say the array final1 and final2 are declared as global but i can only print them in there function. the print @final1 just below that and the print at the end do not work..... .

    • "It doesn't work" is not a very good explanation (some would say it is not an explanation at all) (How (Not) To Ask A Question)
    • my snippet demonstrates why @final1 and @final2 don't contain what you expect. @foo1 = 123; is not the same as push @foo1, 123;
    what is a think-o?
    Its a brain fart (dict thinko)

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re^3: Global vars not accessable globaly
by BrowserUk (Patriarch) on Sep 20, 2004 at 09:30 UTC
    @array = 1; print "@array"; 1 @array = 2; print "@array"; 2 @array = 1; push @array, 2; print "@array"; 1 2

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2022-01-25 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (67 votes). Check out past polls.

    Notices?