RE: call one perl script within another

2003-10-22 Thread Rick Edwards
System will fork a second shell process from the parent and wait for a response when the child process exits (which sounds like what you want). This is not so efficient as exec which kills the parent process. For system: my $return = system (my_script, my_argument); Will start a child process an

Re: Parsing pipe delimited file

2003-10-22 Thread Kevin Pfeiffer
Hi all, Here is what I have so far for this... use strict; # cannot remember syntax for "use warnings but no 'uninitialized' my ($album, @upc_list); my @data_src = parse_data(); print "Data Source: "; print "$_ " foreach @data_src; print "\n"; # test my $album1 = $album->{$upc_list[0]}; fore

Mysql and binary data insert

2003-10-22 Thread Michal Weinfurtner
Hello, I have a question, how to insert binary data into the table by MySql DBI module ? Thanks Michal Weinfurtner

Removing duplicates in arrays

2003-10-22 Thread Marius Roets
I know this has been asked before, but I can't seem to find it. Is there a simple way to remove duplicates from an array. Currently I sort the array, and then iterate through the sorted array, and push elements into a new array when its different than the previous one. I have read somewhere of a on

Re: Removing duplicates in arrays

2003-10-22 Thread Stefan Lidman
>I know this has been asked before, but I can't seem to find it. >Is there a simple way to remove duplicates from an array. >Currently I sort the array, and then iterate through the sorted array, >and push elements into a new array when its different than the previous >one. I have read somewhere of

RE: Removing duplicates in arrays

2003-10-22 Thread Marcos . Rebelo
keys{%{{map {$_=>$_}(@array)}}); -Original Message- From: Marius Roets [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 7:29 AM To: [EMAIL PROTECTED] Subject: Removing duplicates in arrays I know this has been asked before, but I can't seem to find it. Is there a simple way to

trouble backup with perl.

2003-10-22 Thread Goffredo Saffioti
Good Evening all . I'm experiencing to write a perl script for to make backup with afio under perl . But a have some problem when try to execute the system command with the " @_ " this seem to be not the right way for exec this system command "i'm not sure" . but in past time i'm used this kind

Re: Mysql and binary data insert

2003-10-22 Thread Andrew Shitov
You have to have 'blob' filed in your database? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Error while using Bulkmail module

2003-10-22 Thread Chinku Simon
Hi, I am using Mail::Bulkmail module version 3.09 for mail functionality in one of my scripts. The script generates and sends around 4000 mails in a span of 3 hours and at the end of the script there is one last summary mail being sent. But at this point, the Bulkmail generates an error saying

Writing to $?

2003-10-22 Thread Jason
Hi All, I need to write a script that cooperates with a bunch of other scripts in the 'toolbox' paradigm which is often thought of as a core tenet of UNIX philosophy. In particular, when my script fails, the other scripts will look in $? and based on the number therein they will perform some

Re: Writing to $?

2003-10-22 Thread Matthew Harrison
you can use the exit function like so: #!/usr/bin/perl -wT blah..; if (it worked){ exit(0); } else { exit(100); } On Wed, Oct 22, 2003 at 10:41:15AM -0500, Jason wrote: > Hi All, > > I need to write a script that cooperates with a bunch of other scripts > in the 'toolbo

Re: Writing to $?

2003-10-22 Thread Gary Stainburn
On Wednesday 22 Oct 2003 4:41 pm, Jason wrote: > Hi All, > > I need to write a script that cooperates with a bunch of other scripts > in the 'toolbox' paradigm which is often thought of as a core tenet of > UNIX philosophy. In particular, when my script fails, the other > scripts will look in $? a

Re: Error while using Bulkmail module

2003-10-22 Thread Wiggins d Anconia
> Hi, > > I am using Mail::Bulkmail module version 3.09 for mail functionality in one of my scripts. The > script generates and sends around 4000 mails in a span of 3 hours and at the end of the script > there is one last summary mail being sent. > But at this point, the Bulkmail generates an er

RE: Parsing pipe delimited file

2003-10-22 Thread Charles K. Clarkson
Kevin Pfeiffer <[EMAIL PROTECTED]> wrote: : Where I am stuck is on the question: : : Given an @array such as : ("Title of Song", "Artist", "Title", "Another Artist", "etc"), : is there an easy way to strip out the quotation marks. s/"//g foreach @array; HTH, Charles K. Clarkson -- Head

RE: Parsing pipe delimited file

2003-10-22 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Charles K. Clarkson wrote: > Kevin Pfeiffer <[EMAIL PROTECTED]> wrote: > > : Where I am stuck is on the question: > : > : Given an @array such as > : ("Title of Song", "Artist", "Title", "Another Artist", "etc"), > : is there an easy way to strip out the quotation

serial console with perl

2003-10-22 Thread mgoland
Hi All, I am trying to automate some stuff, which requires me to login through serial interfaces on Solaris 8. I have searched CPAN with no luck, and the following code producess tip non-interrective error. Any ideas ?? Thanks in advance, Mark G. midjump# cat ./console #!/usr/local/bin/perl

Weird printing . . .

2003-10-22 Thread Jason
I have a file formatted like this: #error0 # This indicates that there was no # error whatsoever. #error0 #error1 # You have specified no arguments, # so the program ran the 'PrintHelp' # subroutine and then died. #error1 #error2 # If you do not specify a type, then # there is no way

RE: Parsing pipe delimited file

2003-10-22 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, Charles K. Clarkson > wrote: > >> Kevin Pfeiffer <[EMAIL PROTECTED]> wrote: >> >> : Where I am stuck is on the question: >> : >> : Given an @array such as >> : ("Title of Song", "Artist", "Title", "Another A

Re: Weird printing . . .

2003-10-22 Thread Steve Grazzini
On Wed, Oct 22, 2003 at 12:59:33PM -0500, Jason wrote: > I have a file formatted like this: [ snip ] > #error12 > # Couldn't set the transfer mode to binary. > #error12 > > I want to write code that searches for an error number, and then > prints everything in between the two error number lab

Re: Weird printing . . .

2003-10-22 Thread Steve Grazzini
On Wed, Oct 22, 2003 at 02:26:50PM -0400, Steve Grazzini wrote: > #!/usr/bin/perl > # > # [ untested ] > # And it shows... :/ > die "Usage: $0 ERROR\n" unless @ARGV; > > my $num = shift; > my $rx = qr/^#error$num$/; > > while (<>) { > my $range = /$rx/ .. /$rx/; You'd a

RE: Parsing pipe delimited file

2003-10-22 Thread Charles K. Clarkson
Kevin Pfeiffer <[EMAIL PROTECTED]> wrote: : What I came up with (by trying instead of just asking): ;-) : : # removes leading and trailing quote marks : s/^"|"$//g foreach @pairs; It might be more efficient to use two statements like the faq does with leading and trailing space. foreach (

Deleting # and other characters

2003-10-22 Thread Raghu Murthy
I need to remove ./ and #from a list of files. I can do it in sed but I am not able to use it in my perl script. I tried to do something like this chomp ($txtlist = ); qx' sed -e "/^#/d $txtlist'; # To remove lines starting with a # qx' sed -e"s?\([ /]\)\./?\1?g" $txtlist; # To remove lines star

Re: Deleting # and other characters

2003-10-22 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Raghu Murthy wrote: > I need to remove ./ and #from a list of files. I can do it in sed but I am > not able to use it in my perl script. I tried to do something like this > > chomp ($txtlist = ); > qx' sed -e "/^#/d $txtlist'; # To remove lines starting with a # >

Re: Tokens??

2003-10-22 Thread R. Joseph Newton
PerlDiscuss - Perl Newsgroups and mailing lists wrote: Please do not post to this group under false e-mail addresses. Replies to such addresses bring about server error messages. This wastes the time of people who are willingly giving of their time to help others. If you persist in such behavio

Re: Deleting # and other characters

2003-10-22 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, Raghu Murthy wrote: > >> I need to remove ./ and #from a list of files. I can do it in sed but I >> am not able to use it in my perl script. I tried to do something like >> this >> >> chomp ($txtlist = ); >>

help with Very Small Perl?

2003-10-22 Thread McMahon, Chris
Hello... I am booting a FreeBSD system from the network via PXE. On that FreeBSD system is Perl 5.005. I want to use the IO::Socket::INET module in a script on that system. (But I'd settle for Socket.pm) The kicker is that the entire root filesystem must be less than 50 megs. The other kic

Re: help with Very Small Perl?

2003-10-22 Thread Daniel Staal
--On Wednesday, October 22, 2003 16:24 -0600 "McMahon, Chris" <[EMAIL PROTECTED]> wrote: Can anyone suggest either: a way to make IO::Socket::INET work in the simplest possible way on 5.005; or a way to install the smallest possible 5.8; or something I haven't thought of? Any suggestion (no matt

RE: help with Very Small Perl?

2003-10-22 Thread LoBue, Mark
Another crazy idea. > -Original Message- > From: McMahon, Chris [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 22, 2003 3:24 PM > To: [EMAIL PROTECTED] > Subject: help with Very Small Perl? > > > > > Hello... > I am booting a FreeBSD system from the network via PXE. > On that

Making a simple calculator with perl

2003-10-22 Thread Jeff Borders
Hello, I'm a total newbie with only a few programs under my belt. Anyway, I would like to create a command line calculator. Like the one available in python. The python interpreter will accept 5+5 or 5 + 5. I would like some ideas on how to parse the command line. I can read it in as STDIN, b

Re: serial console with perl

2003-10-22 Thread Smoot Carl-Mitchell
On Wed, 22 Oct 2003 13:42:55 -0400 [EMAIL PROTECTED] wrote: > Hi All, > >I am trying to automate some stuff, which requires me to login >through serial interfaces on Solaris 8. I have searched CPAN with >no luck, and the following code producess tip non-interrective >error. Any id

FQN from references

2003-10-22 Thread Gupta, Sharad
Hi All, How do i know the full name of a variable from its reference??. Say i have a routine defined like this: package Bar; sub foo {}; And then i say: my $x = \&foo; Now from this coderef ($x) i want to know its fully qualified name which would be somthing like Bar::Foo. Is there a way to

Re: trouble backup with perl.

2003-10-22 Thread Wiggins d'Anconia
Goffredo Saffioti wrote: Good Evening all . I'm experiencing to write a perl script for to make backup with afio under perl . But a have some problem when try to execute the system command with the " @_ " this seem to be not the right way for exec this system command "i'm not sure" . but in pas

Re: Making a simple calculator with perl

2003-10-22 Thread Wiggins d'Anconia
Jeff Borders wrote: Hello, I'm a total newbie with only a few programs under my belt. Anyway, I would like to create a command line calculator. Like the one available in python. The python interpreter will accept 5+5 or 5 + 5. I would like some ideas on how to parse the command line. I can rea

Re: Making a simple calculator with perl

2003-10-22 Thread simran
On Thu, 2003-10-23 at 10:21, Jeff Borders wrote: > Hello, > > I'm a total newbie with only a few programs under my belt. Anyway, I > would like to create a command line calculator. Like the one available > in python. > > The python interpreter will accept 5+5 or 5 + 5. Perl will as well... he

Re: FQN from references

2003-10-22 Thread Wiggins d'Anconia
Gupta, Sharad wrote: Hi All, How do i know the full name of a variable from its reference??. Say i have a routine defined like this: package Bar; sub foo {}; And then i say: my $x = \&foo; Now from this coderef ($x) i want to know its fully qualified name which would be somthing like Bar::Foo.

Re: FQN from references

2003-10-22 Thread Steve Grazzini
On Wed, Oct 22, 2003 at 08:22:47PM -0500, Wiggins d'Anconia wrote: > Gupta, Sharad wrote: >> Now from this coderef ($x) i want to know its fully qualified name >> which would be somthing like Bar::Foo. Is there a way to do that.??. > > Where do you want to know it? Presumably if you have set it th

RE: FQN from references

2003-10-22 Thread Gupta, Sharad
I can't store it somewhere. I have a routine to which a user can pass a coderef. And in that routine i want to know the full name of that coderef. -Sharad > -Original Message- > From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 22, 2003 6:23 PM > To: Gupta, Shar

RE: FQN from references

2003-10-22 Thread Gupta, Sharad
H!!. I am spinning ;) I'll look at B. The problem was i wanted to know the name of the coderef to generate an error message. Thanx, -Sharad > -Original Message- > From: Steve Grazzini [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 22, 2003 6:58 PM > To: Wiggins d'Anconia > Cc:

Re: FQN from references

2003-10-22 Thread Wiggins d'Anconia
Gupta, Sharad wrote: I can't store it somewhere. I have a routine to which a user can pass a coderef. And in that routine i want to know the full name of that coderef. -Sharad But in that case isn't it just a design issue, to me it would make more sense to pass the name of the routine and call it

Re: FQN from references

2003-10-22 Thread Wiggins d'Anconia
Gupta, Sharad wrote: H!!. I am spinning ;) I'll look at B. The problem was i wanted to know the name of the coderef to generate an error message. Ahh... again depending on your use you may want to have a look at: perldoc -f caller If you haven't, it is very affective for creating traces

DBI sth->row problem

2003-10-22 Thread perl
How can I test the status of $sth itself? A scenario is that a $sth is passed from a sub. And now, I have a $sth. Of course $sth->rows return 0 or whatever int row. However, a test using $sth->rows is not good when something is wrong. It return some large number. So How can I test to see if its ba

SMS messages from Windows

2003-10-22 Thread Rajendra Babu, Praveen
Hi there, Did anyone send free SMS mobile messages from Perl under Windows environment ? If yes, can you please share your "how to ?" Thanks heaps. Best regards, Praveen IMPORTANT- (1) The contents of this email and its attachments are confidential and intended only for the individual o