Re: using a homemade perl module

2007-06-13 Thread Mathew Snyder
To take this further I've changed the code. It now looks like this: package dates_emails; require Exporter; use strict; our @ISA = qw(Exporter); our @EXPORT = qw(startDate, endDate, searchStart, searchEnd); our @EXPORT_OK = qw($emailTo, $emailFrom, $emailBcc); our %EXPORT_TAGS = {

using a homemade perl module

2007-06-13 Thread Mathew Snyder
All I'm looking to do is simplify the creation of several scripts which will use the same bit of code. I've read through the section in Programming Perl for creating my own modules and have what I think is a functioning module. package dates_email; require Exporter; our @ISA = qw(Exporte

Re: Image not updating in PERL

2007-06-13 Thread Tom Phoenix
On 6/13/07, Meenu Jhigan <[EMAIL PROTECTED]> wrote: I am new to PERL scripting and am facing the problem where I can't update the images in the table. You mean "Perl". What table and what images? I don't know whether your table is in a spreadsheet, a database, a web page, or your kitchen. :-)

Re: Getting a program pid

2007-06-13 Thread Paul Lalli
On Jun 13, 7:10 pm, [EMAIL PROTECTED] (Owen) wrote: > I thought there may have been a perl command like "getpid (program)" but it > doesn't seem so. > > The program below is the basis of what I want to do, but my question, Is > there a better way of getting the pid? > > TIA > > Owen > > =

Re: Perl directory listing program

2007-06-13 Thread Chas Owens
On 6/13/07, John W. Krahn <[EMAIL PROTECTED]> wrote: Dr.Ruud wrote: > [EMAIL PROTECTED] schreef: > >> I need a program that will list all of the files in a directory. >> Without any arguments the program will list only the files (not >> directories) in the current directory. But I must have some

Re: Getting a program pid

2007-06-13 Thread oryann9
> > #!/usr/bin/perl -w > > use strict; > > my $program = "vi"; > my $status = `/bin/ps cat | /bin/grep $program`; > > if ( length($status) > 0 ) { > print "$status"; #extract > pid from here > } > else { print "$program not running\n" }# start > program > > =

Re: Perl directory listing program

2007-06-13 Thread John W. Krahn
Dr.Ruud wrote: [EMAIL PROTECTED] schreef: I need a program that will list all of the files in a directory. Without any arguments the program will list only the files (not directories) in the current directory. But I must have some command line options: [...] Might be a 1-liner with usage of

Getting a program pid

2007-06-13 Thread Owen
I thought there may have been a perl command like "getpid (program)" but it doesn't seem so. The program below is the basis of what I want to do, but my question, Is there a better way of getting the pid? TIA Owen #!/usr/bin/perl -w use stric

Re: Perl directory listing program

2007-06-13 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > I need a program that will list all of the files in a directory. > Without any arguments the program will list only the files (not > directories) in the current directory. But I must have some > command line options: [...] Might be a 1-liner with usage of IO::All.

Re: Prompt in Net::Telnet

2007-06-13 Thread Chas Owens
On 6/13/07, Lakshmi Sailaja <[EMAIL PROTECTED]> wrote: snip The reason that I am asking this is that I will have to call one more exe (similar to ls, obtained from free-ware) for my Perl program and that is not running either? snip Chances are good you are talking about Cygwin which is Free Sof

RE: Prompt in Net::Telnet

2007-06-13 Thread Lakshmi Sailaja
The telnet server running on my windows machine is the Microsoft telnet server (which comes from windows). As suggested when I used 'dir', I am able to see the content in lsop.log. 'ls' is an exe that is obtained with some free-ware software. But I don't see any output if I use 'ls'. But isn't the

Re: Help with a perl script to parse and email

2007-06-13 Thread John W. Krahn
Mike wrote: I'm a perl newbie and need help with writing a script to do the following: 1) Open a file that is delimited. The file is in this format: ; The delimiters can be changed. This is a manually created file. Email and user may be more than one item. Use the split function

Re: Database insertion, escape issue

2007-06-13 Thread Chas Owens
On 6/13/07, Northstardomus <[EMAIL PROTECTED]> wrote: snip $sth->execute($values[0], $values[1], $values[3]) or die $dbh- snip Two things: 1. If you always want to die on failure it is easier and safer to say my $dbh = DBI->connect( $dsn, $user, $pass, { RaiserError =>

Image not updating in PERL

2007-06-13 Thread Meenu Jhigan
Hi,   I am new to PERL scripting and am facing the problem where I can't update the images in the table.   I am trying to read an image and update the table if this image is the newest one but the new image doesn't update the old image in the table whereas all the other fields in the table

Re: Database insertion, escape issue

2007-06-13 Thread Northstardomus
On Jun 12, 6:34 pm, [EMAIL PROTECTED] (Chas Owens) wrote: > On 6/12/07, Northstardomus <[EMAIL PROTECTED]> wrote: > snip> $dbh->prepare('INSERT INTO area_status (areaID, survey_date, > > update_time, status ) VALUES (?,?,?,?)'); > > $dbh->execute('$values[0]', '$values[1]', '$values

Help with a perl script to parse and email

2007-06-13 Thread Mike
I'm a perl newbie and need help with writing a script to do the following: 1) Open a file that is delimited. The file is in this format: ; The delimiters can be changed. This is a manually created file. Email and user may be more than one item. 2) Send an email to using the file

Re: What happened to Getopt::Std ?

2007-06-13 Thread John Peacock
Mumia W. wrote: I don't know what is going on. It smells like an attempt to compromise people's systems, although it could be a mistake. Then maybe you should use Google or even look at the distro, before making wild accusations: http://www.nntp.perl.org/group/perl.perl5.porters/2007/04/msg1

Re: Prompt in Net::Telnet

2007-06-13 Thread Chas Owens
On 6/13/07, Lakshmi Sailaja <[EMAIL PROTECTED]> wrote: You are right that I am trying to connect to a Windows m/c from a Solaris server. But when I used the below code, it gets connected but I am having problem displaying the output: my $telnet = Net::Telnet->new(HOST => "$server",

Re: Prompt in Net::Telnet

2007-06-13 Thread Martin Barth
i didnt understand you right, i fear, but if your server is a windows, are you shure that you can execute ls there? On Wed, 13 Jun 2007 12:30:00 -0500 "Lakshmi Sailaja" <[EMAIL PROTECTED]> wrote: > You are right that I am trying to connect to a Windows m/c from a Solaris > server. > > But when

RE: Prompt in Net::Telnet

2007-06-13 Thread Lakshmi Sailaja
You are right that I am trying to connect to a Windows m/c from a Solaris server. But when I used the below code, it gets connected but I am having problem displaying the output: my $telnet = Net::Telnet->new(HOST => "$server", Dump_log => "telnetdump.txt", PROMP

Re: What happened to Getopt::Std ?

2007-06-13 Thread Mumia W.
On 06/13/2007 08:29 AM, John Peacock wrote: Mumia W. wrote: I don't know what is going on. It smells like an attempt to compromise people's systems, although it could be a mistake. Then maybe you should use Google or even look at the distro, before making wild accusations: http://www.nntp.p

Re: loop auto-incrementing array elements

2007-06-13 Thread Gian Sartor
Gian Sartor wrote: Hi All, I have a list in the following format -> room surname firstnames What I would like to is read the file into an array and combine the firstname and surname onto the same line and ignore the room. Below is an example of what I want to do -> Thanks to Paul and Chas.

Re: loop auto-incrementing array elements

2007-06-13 Thread Chas Owens
On 6/13/07, Gian Sartor <[EMAIL PROTECTED]> wrote: Hi All, I have a list in the following format -> room surname firstnames What I would like to is read the file into an array and combine the firstname and surname onto the same line and ignore the room. Below is an example of what I want to do

Re: loop auto-incrementing array elements

2007-06-13 Thread Paul Lalli
On Jun 13, 10:23 am, [EMAIL PROTECTED] (Gian Sartor) wrote: > Hi All, > > I have a list in the following format -> > > room > surname > firstnames > > What I would like to is read the file into an array and combine the > firstname and surname onto the same line and ignore the room. Below is > an ex

loop auto-incrementing array elements

2007-06-13 Thread Gian Sartor
Hi All, I have a list in the following format -> room surname firstnames What I would like to is read the file into an array and combine the firstname and surname onto the same line and ignore the room. Below is an example of what I want to do -> @line = <>; $surname = $line[1]; chomp ($sur

Re: regex for matching repeated strings

2007-06-13 Thread Paul Lalli
On Jun 13, 5:21 am, [EMAIL PROTECTED] (James) wrote: > Thanks all, I have something working > > > $data =~ s/(.*\n)(?=\1)//g; > > Can anyone explain the (?=\1) bit? I get the search replace. Which part do you not understand? The (?=) or the \1 or both? (?= ) is a "positive lookahead assertion".

Re: Set up env variables on Linux

2007-06-13 Thread Paul Lalli
On Jun 13, 1:26 am, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > I'm pretty new to Perl. I was trying to write up a perl script that > can help set up my working env, for example, once log into Linux > server, run the perl script, it'll move to another folder and > configure some env variables.

Re: regex for matching repeated strings

2007-06-13 Thread yitzle
On 6/13/07, James <[EMAIL PROTECTED]> wrote: Thanks all, I have something working > $data =~ s/(.*\n)(?=\1)//g; Can anyone explain the (?=\1) bit? I get the search replace. J. Didn't understand it myself, but see: http://www.boost.org/libs/regex/doc/syntax_perl.html Search for Back reference

Re: Run 2 process in parallel.

2007-06-13 Thread Umesh T G
It's a simple script which has to copy some files. Martin solution will do that job. Thanks :) Zen, I had an impression that running parallel jobs is only threads work. Thanks anyways, Cheers, Umesh On 6/13/07, zentara <[EMAIL PROTECTED]> wrote: On Wed, 13 Jun 2007 15:20:50 +0530, [EMAIL PRO

Re: What happened to Getopt::Std ?

2007-06-13 Thread Miguel Santinho
Em (On) Wed, Jun 13, 2007 at 09:03:09AM +0100, Jorge Almeida escreveu (wrote): > http://search.cpan.org/search?m=module&q=getopt&s=21 What is this Perl Kurila? and why is this (apparently) creating conflicts with some namespaces? http://search.cpan.org/~tty/kurila-0_02/ Miguel pgprv5pnkRfrR.p

Re: Set up env variables on Linux

2007-06-13 Thread Dean
On Jun 13, 6:26 am, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > Hi All, > > I'm pretty new to Perl. I was trying to write up a perl script that > can help set up my working env, for example, once log into Linux > server, run the perl script, it'll move to another folder and > configure some env

Re: Run 2 process in parallel.

2007-06-13 Thread Martin Barth
On Wed, 13 Jun 2007 15:20:50 +0530 "Umesh T G" <[EMAIL PROTECTED]> wrote: > Hola all, > > I have 2 perl scripts which has to run in parallel. > > I have run.pl which inturn has to call > 1. pl and 2. pl; > I am not sure how I can do it using the Perl Threads. > > Can someone throw some light h

Re: What happened to Getopt::Std ?

2007-06-13 Thread Mumia W.
On 06/13/2007 03:03 AM, Jorge Almeida wrote: http://search.cpan.org/search?m=module&q=getopt&s=21 Hmm: http://search.cpan.org/~tty/kurila-0_02/ Hmm: http://search.cpan.org/src/TTY/kurila-0_02/ It looks like this person, TTY, uploaded a modified version of Perl to his/her CPAN director

Re: Set up env variables on Linux

2007-06-13 Thread Mumia W.
On 06/13/2007 12:26 AM, [EMAIL PROTECTED] wrote: Hi All, I'm pretty new to Perl. I was trying to write up a perl script that can help set up my working env, for example, once log into Linux server, run the perl script, it'll move to another folder and configure some env variables. I tried using

Run 2 process in parallel.

2007-06-13 Thread Umesh T G
Hola all, I have 2 perl scripts which has to run in parallel. I have run.pl which inturn has to call 1. pl and 2. pl; I am not sure how I can do it using the Perl Threads. Can someone throw some light here. I am not sure how I can achieve it. TIA, Cheers, Umesh

Re: Set up env variables on Linux

2007-06-13 Thread Madan Kumar Nath
Hello,     "cd" does not work as expected in perl.     use chdir instead and it will do what u want .     ex : chdir  "dest_folder"  # go to directory     system("ls ")  # do what u want.     chdir "orignal_folder"  # come back to orignal dir Thanx

Re: regex for matching repeated strings

2007-06-13 Thread James
Thanks all, I have something working > $data =~ s/(.*\n)(?=\1)//g; Can anyone explain the (?=\1) bit? I get the search replace. J. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Set up env variables on Linux

2007-06-13 Thread [EMAIL PROTECTED]
Hi All, I'm pretty new to Perl. I was trying to write up a perl script that can help set up my working env, for example, once log into Linux server, run the perl script, it'll move to another folder and configure some env variables. I tried using `cd dest_folder` or system "

How to perform filetests on unicode filenames?

2007-06-13 Thread tinaa
I was trying to write a program that extracts filenames from an XML file. The filenames in the XML are represented as URLs with percent encoding. So I converted those to a regular path string (as used in Windows XP SP2) and tried to perform a -e filetest to see if the file is actually present. This

What happened to Getopt::Std ?

2007-06-13 Thread Jorge Almeida
http://search.cpan.org/search?m=module&q=getopt&s=21 -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/