Hi -

> -----Original Message-----
> From: jimf [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 01, 2003 12:14 AM
> To: [EMAIL PROTECTED]
> Subject: creating prefixes to open a file
>
>
> I want to open a file and change a single value, its a print quota file
> and I want to be able to change the users print credit limit. The line I
> want to change looks like this,
>
> quota=100
>
> the path to the file (always the same name) varies only by the group
> directory ie,
>
> /server/users/y8
> /server/users/y9
> /server/users/y10
>
> I wanted to create a prefix ($prefix) so that I dont have to type the full
> path all the time, unfortunately this returns the error,
>
> Opening: No such file or directory at ./credits.pl line 5.
>
> removing $prefix opens the file perfectly. Help appreciated.
>
> [EMAIL PROTECTED]
>
>
>
> #########################################################
> #!/usr/local/bin/perl -w
> #credits.pl
>
> $prefix = "/home/jimf/Desktop/";
> open(PRNT, "+< $prefix, file.ini") or die "Opening: $!"; @ARRAY = <PRNT>;
> print "@ARRAY" or die "Printing: $!";
> #########################################################
>

try putting your path and file name together, like this:

 open(PRNT, "+< ${prefix}file.ini") or die "Opening: $!"; @ARRAY = <PRNT>;

(the {}s are needed to tell perl that $prefix is indended,
not $prefixfile).

Aloha => Beau;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to