Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] Need Help With Global Sub



******    message to minivend-users from "Cameron B. Prince" <cbp@InternetExpertsLLC.com>     ******

Hi List,

I have a problem getting a globalsub to run that is accessing an external
file. I need to read this file and create a scratch variable with it.

I am trying to use this perl code:


open (FILE, '$quote_log');
chomp (@LINES = (<FILE>));
close(FILE);


I have also tried:


open (TABFILE,"$quote_log") || die "Can't Open $quote_log: $!\n";
@LINES=<TABFILE>;
chomp @LINES;
close(TABFILE);



I am getting these errors:

[22/May/2000:01:15:20 -0500] /cgi/catalog/multi/basket.html Runtime error:
Unable to create sub named "" at /usr/local/minivend/lib/Vend/Interpolate.pm
line 1495.

May 22 00:50:06 http minivend: Global symbol "@lines" requires explicit
package name at (eval 90) line 5, <GLOBAL> chunk 50.


If I rem out the chomp function in the first example, I don't get any
errors. The errors only seem to happen when I try to create the @LINES
array. I have tested my code in an external script and it works as expected.

Would a kind soul tell me how to create an array read from an external file
in a globalsub?


Thanks,

Cameron






-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: