Grand_Phallus has asked for the wisdom of the Perl Monks concerning the following question:
I'd appreciate any pointers/suggestions!print SMBCLIENT "Hi there/n";
The file I'm reading from looks like this:open (MESSAGE, "/print_quota/windows/quota_message"); while (<MESSAGE>){ s/USER-LOGIN/$login/; s/PAGES-PRINTED/$pages/; if($pagestate eq "duplex"){ s/PAGESTATE/double sided/; } elsif ($pagestate eq "simplex"){ s/PAGESTATE/single sided/; } s/PRINTER/$printer/; s/QUOTA-USED/$quota/; s/POST-QUOTA/$report[2]/; s/ORIGINAL-QUOTA/$report[1]/; s/PRINTER/$printer/; s/MULTIPLIER/$multiplier/; open (SMBCLIENT, "|/usr/bin/smbclient -U Print_Quota -M $report[0] + -I $hostip[0]"); print SMBCLIENT "$_"; close SMBCLIENT; } close MESSAGE;
As you may have guessed, this is a print accounting script.This is a test. Print quotas have yet to be fully implemented!\n\nYou, + USER-LOGIN, have printed PAGES-PRINTED page(s) PAGESTATE on the prin +ter \"PRINTER\".\n\nYou used QUOTA-USED credits on this print job, an +d you currently have POST-QUOTA quota credits left of your original O +RIGINAL-QUOTA.\nThe printer \"PRINTER\" is worth MULTIPLIER quota cre +dit(s).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: A string from a file
by tye (Sage) on May 05, 2001 at 03:41 UTC | |
|
Re: A string from a file
by Rhandom (Curate) on May 05, 2001 at 02:42 UTC | |
by entropy (Sexton) on May 05, 2001 at 04:57 UTC | |
by Grand_Phallus (Novice) on May 07, 2001 at 23:33 UTC |