Re: 2 -D arry in perl

2005-03-09 Thread Ramprasad A Padmanabhan
Adam Saeed wrote: hi i am some new to per;. I want to get a day numbers by year and store them in e a 2 -d array, getting data from mysql. i.e data[dayofyear][year] BUT I COULD NOT GETTING THE DESIRE RESULT ... ANY HELP my snap code is: ... ... @year #have list of years my $i=0; my @dayofyear=

mail question

2005-03-09 Thread Amy Kline
Hi, How do I modify the following code to email a file (textfile.txt) to [EMAIL PROTECTED] open (MAIL, "|/usr/bin/mail [EMAIL PROTECTED]"); print MAIL "Subject: test"; print MAIL "This is a test"; close MAIL; The above code works fine but instead of sending the text - "This is a test", I would li

Re: mail question

2005-03-09 Thread Peter Rabbitson
IIRC (no time to test right now) you simply change the disposition to 'inline' and attach a file like in the example below. On Wed, Mar 09, 2005 at 07:29:14AM -0500, Amy Kline wrote: > Peter, thanks for the sample code. Is there a way that I can display > the text file as inline text instead of

Re: log rotate on multiple files

2005-03-09 Thread DBSMITH
got it dude! thanks; my code is foreach ( $file1, $file2, $file3, $file4 ) { my $logs = new Logfile::Rotate (File => $_, Count => 10, Gzip => '/usr/bin/gzip', Dir

Testing for a '\' in a string

2005-03-09 Thread Bret Goodfellow
Hi all, I am trying to evaluate a string, and determine if the last charater of the string has a backslash '\' . The piece of code I am using doesn't appear to work. What I've found with this peice of code is that if the string does contain a \, then the following code still adds another slash.

RE: Testing for a '\' in a string

2005-03-09 Thread Bob Showalter
Bret Goodfellow wrote: > Hi all, > > I am trying to evaluate a string, and determine if the last charater > of the string has a backslash '\' . The piece of code I am using > doesn't appear to work. What I've found with this peice of code is > that if the string does contain a \, then the follow

Re: Testing for a '\' in a string

2005-03-09 Thread Lawrence Statton
> --_=_NextPart_001_01C524BC.E5934C9B > Content-Type: text/plain; > charset="us-ascii" > Content-Transfer-Encoding: quoted-printable > > Hi all, > =20 > I am trying to evaluate a string, and determine if the last charater of > the string has a backslash '\' . The piece of code I am usin

Re: mail question

2005-03-09 Thread Peter Scott
On Tue, 08 Mar 2005 18:00:52 -0500, Amy Kline wrote: > Hi, > How do I modify the following code to email a file (textfile.txt) to > [EMAIL PROTECTED] > > open (MAIL, "|/usr/bin/mail [EMAIL PROTECTED]"); > print MAIL "Subject: test"; > print MAIL "This is a test"; > close MAIL; > > The above code

NIC Cards

2005-03-09 Thread Benjamin Jeeves
Hi all Silly question but I have two Nic cards in my system and I want my perl program to use my second nic e.g. eth1 not eth0 as it is now. Thank you Ben -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: NIC Cards

2005-03-09 Thread Chris Devers
On Wed, 9 Mar 2005, Benjamin Jeeves wrote: > Silly question but I have two Nic cards in my system and I want my > perl program to use my second nic e.g. eth1 not eth0 as it is now. Okay. So use it. I'm sorry, was there a question about a specific program here? Care to share some code that illu

Re: NIC Cards

2005-03-09 Thread Lawrence Statton
> Hi all > > Silly question but I have two Nic cards in my system and I want my perl > program to use my second nic e.g. eth1 not eth0 as it is now. > > Thank you > > Ben > Assuming context of: Modern unix-or-unix-like-system. There is no portable way to force the network stack to prefer a

Passing parameters into post

2005-03-09 Thread Tham, Philip
It seems that to pass paramenters into a post I can use the following method my $rq=HTTP::Request->new(POST => http://www.posturl.com,["name"; => "Philip", "gender" => "male"]); What if the paramenters like name and gender are stored in an associative array which may be variable. I tried passing

Re: NIC Cards

2005-03-09 Thread Lawrence Statton
> Assuming context of: Modern unix-or-unix-like-system. > > There is no portable way to force the network stack to prefer a given > interface at the client-application level. A call to connect(3) in > the library will select the near endpoint based on the destination > IP-addr. > Mea culpa ..

Re: NIC Cards

2005-03-09 Thread Benjamin Jeeves
I have some code that will move data around my network to different systems on it but what I have seen this that it will all ways use eth0 and not eth1. So I want to know if there was a way to force my program to use eth1 not eth0 with me. Thank you Ben On Wednesday 09 March 2005 17:49, Chr

****POSIBLE SPAM**** Re: 2 -D arry in perl

2005-03-09 Thread Marco Antonio Manzo
On Wed, 2005-03-09 at 11:03 +0500, Adam Saeed wrote: > hi i am some new to per;. > I want to get a day numbers by year and store them in e a 2 -d array, > getting data from mysql. i.e data[dayofyear][year] BUT I COULD NOT > GETTING THE DESIRE RESULT ... ANY HELP my snap code is: > ... > ... >

Re: NIC Cards

2005-03-09 Thread Benjamin Jeeves
Hi Thank you I will let you know if it works if you want me to but it will not be until Monday now. Thank you Ben On Wednesday 09 March 2005 19:02, Lawrence Statton wrote: > > Assuming context of: Modern unix-or-unix-like-system. > > > > There is no portable way to force the network stack to

Re: Passing parameters into post

2005-03-09 Thread Lawrence Statton
> It seems that to pass paramenters into a post I can use the following > method > > my $rq=HTTP::Request->new(POST => http://www.posturl.com,["name"; => > "Philip", "gender" => "male"]); Well, fixing the typo of missing quotes around the URL, what you will have done there is created a request wi

execute >1 actions after die

2005-03-09 Thread susan lam
Is it possible to execute two actions such as a print statement and a subroutine after die? open(FILE, $file) || die "Cannot open file" && email()??? thanks in advance. susan __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protec

RE: execute >1 actions after die

2005-03-09 Thread Bob Showalter
susan lam wrote: > Is it possible to execute two actions such as a print > statement and a subroutine after die? > > open(FILE, $file) || die "Cannot open file" && > email()??? open(FILE, $file) or email(), die "Cannot open file"; or, perhaps more readable: unless(open(FILE, $file)) {

RE: execute >1 actions after die

2005-03-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
susan lam wrote: > Is it possible to execute two actions such as a print > statement and a subroutine after die? No. What you should do, is the other actions first and then the die or one way: if ( ! open(FILE, $file) ) { sub1(); sub2();

Help parsing on Columns...?

2005-03-09 Thread Tim Musson
I have the following data in @return from my @return = `command $Server\\$user`; I would like to put it in a hash. So the first line would be$hash{User_Name} = userid How would I go about doing this? I have tried this, but not all the key names are built the same (some with spaces

RE: Passing parameters into post

2005-03-09 Thread Tham, Philip
Basically I would like to have a POST will have the content length and at the end a data section containing at the end name=Philip&gender=mail which can be read on the server side CGI with query->param('name') and query->param('gender') -Original Message- From: [EMAIL PROTECTED]

PDF creation

2005-03-09 Thread Peter Rabbitson
I would like to hear opinions (pros/cons) about the two apparently available methods for realatively easy PDF output creation - PDF::Create and PDF::API2. I figured I might listen to people that have used them with or without luck, before figuring out which one (or neither) would give me better

Re: PDF creation

2005-03-09 Thread Wiggins d'Anconia
Peter Rabbitson wrote: I would like to hear opinions (pros/cons) about the two apparently available methods for realatively easy PDF output creation - PDF::Create and PDF::API2. I figured I might listen to people that have used them with or without luck, before figuring out which one (or neither

Re: Help parsing on Columns...?

2005-03-09 Thread Wiggins d'Anconia
Tim Musson wrote: I have the following data in @return from my @return = `command $Server\\$user`; I would like to put it in a hash. So the first line would be$hash{User_Name} = userid How would I go about doing this? I have tried this, but not all the key names are built the same (s

Re: PDF creation

2005-03-09 Thread Lawrence Statton
> I would like to hear opinions (pros/cons) about the two apparently available > methods for realatively easy PDF output creation - PDF::Create and > PDF::API2. I figured I might listen to people that have used them with or > without luck, before figuring out which one (or neither) would give me

Issue reading password from STDIN after STDIN was read from redirect.

2005-03-09 Thread Anthony Tippett
I've have a program that reads input from STDIN like so: example: program < file.txt and then I try to read a password from STDIN that the user types in but it skips right over that section. Do I have to do anything to STDIN before I try to get user input from it? Perhaps close and reopen it?

Re: Help parsing on Columns...?

2005-03-09 Thread John W. Krahn
Tim Musson wrote: I have the following data in @return from my @return = `command $Server\\$user`; I would like to put it in a hash. So the first line would be$hash{User_Name} = userid How would I go about doing this? I have tried this, but not all the key names are built the same (s

Execute application with a space in it's path

2005-03-09 Thread Daniel Kasak
Hi all. I'm trying to open Adobe Acrobat on Windows from Perl. I can get to the 'Adobe' folder with the commands ( from the command prompt ): c: cd c:\Progra~1\Adobe However I can't get into the 'Acrobat 7.0' folder in the same way, ie: c: cd c:\Progra~1\Adobe\Acroba~1 I've had 2 version of Acrob

Re: PDF creation

2005-03-09 Thread Daniel Kasak
Peter Rabbitson wrote: I would like to hear opinions (pros/cons) about the two apparently available methods for realatively easy PDF output creation - PDF::Create and PDF::API2. I figured I might listen to people that have used them with or without luck, before figuring out which one (or neither

RE: Execute application with a space in it's path

2005-03-09 Thread Tim Johnson
Chances are the correct 8.3 filename you're looking for is Acroba~2, but why are you using the old 8.3 filenames? If you're just worried about spaces, try putting quotes in the command you're sending to the system, like this: system("\"C:\\Program Files\\Adobe\\Acrobat 7.0\\Reader\\AcroRd32.exe\

Re: Execute application with a space in it's path

2005-03-09 Thread Daniel Kasak
Tim Johnson wrote: Chances are the correct 8.3 filename you're looking for is Acroba~2, but why are you using the old 8.3 filenames? Because I don't know any better :) If you're just worried about spaces, try putting quotes in the command you're sending to the system, like this: system("\"C:\\Pr

Reg Exp Help

2005-03-09 Thread Trina Espinoza
Var $machine_status contains this block of data: machine_status = "Pinging 129.111.3.79 with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out. Ping statistics for 192.111.3.79: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), Approximate round tr

Re: Reg Exp Help

2005-03-09 Thread John W. Krahn
Trina Espinoza wrote: Var $machine_status contains this block of data: machine_status = "Pinging 129.111.3.79 with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out. Ping statistics for 192.111.3.79: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)