Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: question about star character in Perl

by kennethk (Abbot)
on Jan 17, 2013 at 23:41 UTC ( #1013915=note: print w/replies, xml ) Need Help??


in reply to question about star character in Perl

The * sigil refers to Typeglobs and Filehandles. In this case, the author wanted to pass the newly-opened XML filehandle into a subroutine, and old fashioned Perl didn't have a particularly clean way to pass one. Nowadays, you'd probably write that as:
open (my $XML, "<", $xml_file) or die "File open failed ($xml_file): +$!; get_data($XML, \%hash);

The indirect filehandle makes passing and stashing much cleaner (IMHO). See also open and Indirect Filehandles in perlopentut.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: question about star character in Perl
by dicty (Sexton) on Jan 18, 2013 at 17:03 UTC
    Got it. Thanks a lot!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013915]
help
Chatterbox?
[marto]: it's a shame Solaris is such a PITA to build on :)
LanX great movie!
[Discipulus]: ah i become monsignor the same day of sysadmin day
[marto]: not so great OS :P
Eily never heard of the movie "LanX"
[Eily]: the LanX OS either now that I think of it :P
[hippo]: Congratulations, Discipulus!
[Discipulus]: Satura Lanx was a latin genre of show
[Discipulus]: coming from the meaning of 'mixed dish'

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-07-28 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (426 votes). Check out past polls.