Shawn McKinley
Dec 18 2003, 02:35 PM
Does anyone know of a way to find the default printer?
I have found there are some ways to do it on a single
platform, but I was wondering if there is a way to do
it without any OS proprietary code.
I have a script that will need to find the default
printer on Win(98 - XP), *nix, and Mac(OS 8 and 9).
TIA,
Shawn
Agftech Lists
Dec 18 2003, 03:44 PM
YOu may use Printer.pm
I have only used with Linux but seems the Printer() print_command() take
the platform dependent arguments.
You can use control statements and take care of that.
There might be a better answer, I'll look forward to it.
HTH
On Thu, 2003-12-18 at 08:35, Shawn McKinley wrote:
QUOTE |
Does anyone know of a way to find the default printer?
I have found there are some ways to do it on a single platform, but I was wondering if there is a way to do it without any OS proprietary code.
I have a script that will need to find the default printer on Win(98 - XP), *nix, and Mac(OS 8 and 9).
TIA, Shawn
|
______________________
Aman Raheja
AGF Technologies
http://www.agftech.com______________________
Jeff Westman
Dec 18 2003, 07:31 PM
Eric Walker <[Email Removed]> wrote:
QUOTE |
I got it so I need a counter which sends me to a for loop instead of a foreach. Thanks..
perlknucklehead
|
I believe that 'for' and 'foreach' are completely interchangable. I remember
reading somewhere that one was a synonym for the other.
Maybe someone who is more familiar with the internals can confim that.
-Jeff
QUOTE |
On Thu, 2003-12-18 at 17:07, Paul Johnson wrote: On Thu, Dec 18, 2003 at 04:57:26PM -0700, Eric Walker wrote:
Hello all While traversing a loop across and array, how can I access array positions further down the array, like say if I am on a loop looking at position 23, how can I check the value of say position 24 or 32 while my loop counter is on position 23.
Hmmm? Add 1 or 9 to your loop counter?
Or have you not actually got a loop counter? If that is the case the easiest solution is probably to get one.
Or have I completely misunderstood? Showing the code is usually more productive than simply describing the problem.
-- Paul Johnson - [Email Removed] http://www.pjcj.net
-- To unsubscribe, e-mail: [Email Removed] For additional commands, e-mail: [Email Removed] <http://learn.perl.org/> <http://learn.perl.org/first-response
|
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
Jeff Westman
Dec 18 2003, 07:44 PM
Paul Johnson <[Email Removed]> wrote:
QUOTE |
On Thu, Dec 18, 2003 at 07:26:03PM -0500, Randy W. Sims wrote: On 12/18/2003 7:00 PM, James Edward Gray II wrote: On Dec 18, 2003, at 5:48 PM, Mike Blezien wrote:
Hello,
been trying to come up with a way, while going through a loop to alternate a table cell color <td></td>....
See if this gets you thinking along the right lines:
my $odd = 1; while (<>) { # some kind of loop... if ($odd) { # do something $odd = 0; } else { # do something else $odd = 1; } }
or
my $alt; while (<>) { # some kind of loop... if ($alt = !$alt) { # do something } else { # do something else } }
or
while (<>) { if ($|--) { # do something
|
HUH?????? Why are you decrementing the $OUTPUT_AUTOFLUSH variable as an
'alternate' for loop???!
Sorry, I don't follow you here.........
-JW
QUOTE |
} else { # do something else } }
Oh, no. Hold on. On second thoughts ...
-- Paul Johnson - [Email Removed] http://www.pjcj.net
|
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
Randy W. Sims
Dec 19 2003, 04:04 AM
On 12/20/2003 8:21 AM, David Inglis wrote:
QUOTE |
I am reading in a csv file and it has a control character ^M at the end of each line how can I remove these charaters, I have tried the following and had no success.
$a=~s/^M//; $a=~s/^M//;
Any help appreciated thanks.
|
^M is the carriage return. Try s/x0D//;
Regards,
Randy.
Tom Kinzer
Dec 19 2003, 07:55 AM
tr/015//;
-Tom Kinzer
-----Original Message-----
From: Randy W. Sims [mailto:[Email Removed]]
Sent: Thursday, December 18, 2003 8:05 PM
To: David Inglis
Cc: [Email Removed]
Subject: Re: how to remove a ^M charaters from a variable
On 12/20/2003 8:21 AM, David Inglis wrote:
QUOTE |
I am reading in a csv file and it has a control character ^M at the end of each line how can I remove these charaters, I have tried the following and had no success.
$a=~s/^M//; $a=~s/^M//;
Any help appreciated thanks.
|
^M is the carriage return. Try s/x0D//;
Regards,
Randy.
--
To unsubscribe, e-mail: [Email Removed]
For additional commands, e-mail: [Email Removed]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Jaffer
Dec 19 2003, 08:44 AM
Hai David,
I don't where you tried this
have you tried this in NT or in UNIX?
$a="jaffer^";
$a=~s/^M//; This works in NT
print $a;
But it wont works in Unix.
Try this way in Unix $a=~s/ 15//g;
Let me know if any....
Thank you
jaffer
-----Original Message-----
From: David Inglis [mailto:[Email Removed]]
Sent: Saturday, December 20, 2003 6:51 PM
To: [Email Removed]
Subject: how to remove a ^M charaters from a variable
I am reading in a csv file and it has a control character ^M at the end
of each line how can I remove these charaters, I have tried the following
and had no success.
$a=~s/^M//;
$a=~s/^M//;
Any help appreciated thanks.
--
Regards
David Inglis
--
To unsubscribe, e-mail: [Email Removed]
For additional commands, e-mail: [Email Removed]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Rob Dixon
Dec 19 2003, 11:06 AM
Tom Kinzer wrote:
This will do nothing to the string. It will just return the
number of zero, one and five characters it finds.
Control-M is
"cM"
or
"x0D"
or
"