Forcing list context on <$fh>

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I have a CGI-script for creating new users.
You can either upload a CSV file for a batch
of users or fill out a web for for just 1 user.

So I have a ref to array which contains
either lines from the uploaded CSV file or
just 1 line constructed from the web form:

        my $input = $fh ? [ <$fh> ] :
            # trick: create a line as if a Lotus Notes CSV-file has
been uploaded
            [ sprintf '%s;%s;;;%s;XXX;%s;;;XXX;%s-%s;;%s%s.;;XXX;;;;%s;',
                ($QUERY->param('company') =~ /^mycompany$/i ? '' :
                ($QUERY->param('inform') =~ /nobody/i ? '' : $QUERY-
Quoted text here. Click to load it

        my $loh = validate_input($input);

My problem above is that [ <$fh> ] seems
to be evaluated in a scalar context and
I get just 1 line instead of all.

Is there a nice way to force list context on it?


Site Timeline