Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Web Browser File Upload Progress Bar in Perl w/AJAX

by skx (Parson)
on Dec 11, 2006 at 06:25 UTC ( #588988=note: print w/replies, xml ) Need Help??

in reply to Web Browser File Upload Progress Bar in Perl w/AJAX

is this: $q = CGI->new(\&hook [,$data [,$use_tempfile]]); valid Perl?


Although it is not literal perl. The first argument "\&hook" is a reference to the subroutine "hook".

The second argument is optional, and thus enclosed in [ and ] characters, and similarly the last argument is optional.

So you could call it in three ways:

# just one argument. $q = CGI->new(\&hook); # two arguments. $q = CGI->new(\&hook ,$data ); # all three - party time! $q = CGI->new(\&hook ,$data, $use_tempfile);

Under Unix-like systems there is a convention that optional arguments are enclosed in "[" and "]" characters. For a simple example of that try readng "man ls" which has the following output:

ls [OPTION]... [FILE]...

Replies are listed 'Best First'.
Re^2: Web Browser File Upload Progress Bar in Perl w/AJAX
by skazat (Chaplain) on Dec 11, 2006 at 12:02 UTC
    I see - and sort of what I thought it may be - still, it's very odd, since it's the only example in the entire documentation of the module that has that style. Had to do a mental style switch in the noggin' there (although the docs right after it explain it well enough)

    Thanks for the clarification.


    -justin simoni
    skazat me

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2021-03-03 22:15 GMT
Find Nodes?
    Voting Booth?
    My favorite kind of desktop background is:

    Results (96 votes). Check out past polls.