RE: $ ^ I in place editor

2004-09-15 Thread kamal.gupta
Hi, First of all are you sure that the program didn't give any compilation errors?? > >my stps="/usr/local/log/scratchtps"; > I think that's a typo. It should be $stps The code that you have given, is it complete?? Coz you are saying 'use strict' and without "my"ing you are using $logf, $irmt

Re: can't use Scalar ref...

2004-09-15 Thread JupiterHost.Net
JN> Then you need to do 'no strict;' before you do that: JN> no strict; JN> $x =~ s/^\[%([^%]+)%\]$/${$1}/g; JN> use strict; I think turning off strict is bad idea, also, that doesn't work either. It is a bad idea but it is what needs done to use soft references like you are doing. JN> Why not ju

Re: Net ::FTP and subroutine calls

2004-09-15 Thread Chris Devers
On Wed, 15 Sep 2004 [EMAIL PROTECTED] wrote: > no nothing is showing up in the file. Here is where I looked for > information on Net::FTP > > http://search.cpan.org/~gbarr/libnet-1.19/Net/libnetFAQ.pod > > ok I will look in perldoc -f package. Is there a better place though? If you're old-fa

Re: Net ::FTP and subroutine calls

2004-09-15 Thread DBSMITH
no nothing is showing up in the file. Here is where I looked for information on Net::FTP http://search.cpan.org/~gbarr/libnet-1.19/Net/libnetFAQ.pod ok I will look in perldoc -f package. Is there a better place though? Chris Devers <[EMAIL PROTECTED]> 09/15/2004 07:04 PM Please respond

RE: First module

2004-09-15 Thread perl.org
> you certainly have given this module more thought than I did, To be fair, I've had to write this for about 10 clients in 3 languages (Java, C# and Perl). -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

$ ^ I in place editor

2004-09-15 Thread DBSMITH
All, In my code I am not understanding why my in place edit does not work? Here is my code: please help! thanks, use strict; use diagnostics; use warnings; my stps="/usr/local/log/scratchtps"; open (TP, ">$stps") || die "could not open file:$!"; open (TP2, ">$irmt ") || die "cou

Re: can't use Scalar ref...

2004-09-15 Thread Ing. Branislav Gerzo
Jenda Krynicky [JK], on Thursday, September 16, 2004 at 00:34 (+0200) typed the following: JK> You most probably want to store the data you want to fill into the JK> template in a hash (some call it associative array, please don't): JK> my %data = ( JK>foo =>> 'test', JK>bar =>> '

Re: Net ::FTP and subroutine calls

2004-09-15 Thread Chris Devers
On Wed, 15 Sep 2004 [EMAIL PROTECTED] wrote: The Python folks are right -- whitespace is your friend! Use it! > sub ftpme { > > my $remotehost = "ftp.digitalarchives.com"; > my $user = "cb100524"; > my $pass = "xxx"; > my $data = $scratch

RE: First module

2004-09-15 Thread Johnstone, Colin
Hi John, you certainly have given this module more thought than I did, you've given me something to think about. Thank you. Colin -Original Message- From: perl.org [mailto:[EMAIL PROTECTED] Sent: Thursday, September 16, 2004 1:27 AM To: [EMAIL PROTECTED] Subject: Re: First module Hoo

Re: can't use Scalar ref...

2004-09-15 Thread Gunnar Hjalmarsson
JupiterHost.Net wrote: Ing. Branislav Gerzo wrote: I want change [%foo%] to $foo, so I expect in result 'test' as before defined. Then you need to do 'no strict;' before you do that: no strict; $x =~ s/^\[%([^%]+)%\]$/${$1}/g; use strict; Well, a better suggestion IMO would be that $foo is replaced

Re: How to determine Operating System

2004-09-15 Thread Chris Devers
On Thu, 16 Sep 2004, Jenda Krynicky wrote: > perldoc perlvar > ... > > $OSNAME > $^O The name of the operating system under which this copy of > Perl > was built, as determined during the configuration > process. Be careful when matching against this though. If yo

Re: How to determine Operating System

2004-09-15 Thread Jenda Krynicky
From: "JP" <[EMAIL PROTECTED]> > Perl being multiplatform, I need some function that returns something > like SunOs 5.8 on Solaris 8 or Cygwin on Cygwin, Windows-XP on an XP > host etc. to execute platform specific sub routines. perldoc perlvar ... $OSNAME $^O The name of the

Re: can't use Scalar ref...

2004-09-15 Thread Ing. Branislav Gerzo
JupiterHost.Net [JN], on Wednesday, September 15, 2004 at 17:21 (-0500) made these points: JN> Then you need to do 'no strict;' before you do that: JN> no strict; JN> $x =~ s/^\[%([^%]+)%\]$/${$1}/g; JN> use strict; I think turning off strict is bad idea, also, that doesn't work either. JN> Why

Re: can't use Scalar ref...

2004-09-15 Thread Jenda Krynicky
From: "Ing. Branislav Gerzo" <[EMAIL PROTECTED]> > use strict; > use warnings; > > my $foo = 'test'; > my @bar = ( 'foo', '[%foo%]', 'bar' ); > my @list = (); > > foreach my $x (@bar) { > $x =~ s/^\[%([^%]+)%\]$/${$1}/g; > print $x . " "; > } > > -- > ...it gives me compilation

Re: can't use Scalar ref...

2004-09-15 Thread Jeff 'japhy' Pinyan
On Sep 15, Ing. Branislav Gerzo said: >use strict; >use warnings; > >my $foo = 'test'; >my @bar = ( 'foo', '[%foo%]', 'bar' ); >my @list = (); > >foreach my $x (@bar) { >$x =~ s/^\[%([^%]+)%\]$/${$1}/g; >print $x . " "; >} You should use a hash instead of a set of variables. my

Re: How to determine Operating System

2004-09-15 Thread JupiterHost.Net
JP wrote: Perl being multiplatform, I need some function that returns something like SunOs 5.8 on Solaris 8 or Cygwin on Cygwin, Windows-XP on an XP host etc. to execute platform specific sub routines. see perldoc Config -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

How to determine Operating System

2004-09-15 Thread JP
Perl being multiplatform, I need some function that returns something like SunOs 5.8 on Solaris 8 or Cygwin on Cygwin, Windows-XP on an XP host etc. to execute platform specific sub routines. Thanks! JP -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

Re: can't use Scalar ref...

2004-09-15 Thread JupiterHost.Net
Ing. Branislav Gerzo wrote: JupiterHost.Net [JN], on Wednesday, September 15, 2004 at 16:52 (-0500) made these points: my $foo = 'test'; my @bar = ( 'foo', '[%foo%]', 'bar' ); JN> The question would be why you're doing ${$1} since nothing in @bar is a JN> reference. I want change [%foo%] to $foo,

RE: time managing

2004-09-15 Thread Stout, Joel R
Microsoft Scheduler also sucks but not quite as bad as "at". I'd look into the Windows Cron first but you can also run a daemon (below). #your shebang use strict; use POSIX; # Start the loop for the daemon while(1) { my(@now) = localtime(); my($today) = POSIX::strftime( "%m

Net ::FTP and subroutine calls

2004-09-15 Thread DBSMITH
All, I have this ftp code sub ftpme { my $remotehost="ftp.digitalarchives.com"; my $user="cb100524"; my $pass="xxx"; my $data=$scratchtps; my $ftplog="/usr/local/log/ftp_IrMt_scratchtapes.log";

Re: can't use Scalar ref...

2004-09-15 Thread Ing. Branislav Gerzo
JupiterHost.Net [JN], on Wednesday, September 15, 2004 at 16:52 (-0500) made these points: >> my $foo = 'test'; >> my @bar = ( 'foo', '[%foo%]', 'bar' ); JN> The question would be why you're doing ${$1} since nothing in @bar is a JN> reference. I want change [%foo%] to $foo, so I expect in result

Re: can't use Scalar ref...

2004-09-15 Thread JupiterHost.Net
Ing. Branislav Gerzo wrote: Hi pals, Hello, use strict; use warnings; my $foo = 'test'; my @bar = ( 'foo', '[%foo%]', 'bar' ); my @list = (); foreach my $x (@bar) { $x =~ s/^\[%([^%]+)%\]$/${$1}/g; its esentially doing ${foo} since the string foo is in @bar. that is a soft reference and no

Re: output to one changing line

2004-09-15 Thread JupiterHost.Net
Tim Johnson wrote: That doesn't work on my WinXP, but this does... perl -e "$|=1; print \"\rLine $_\" and sleep 1 for 1..3; print \"\n\"" Its because you used double quotes instead of single quotes to surround the expression and need to escape the internal ones :) Try this (paste it exactly as i

can't use Scalar ref...

2004-09-15 Thread Ing. Branislav Gerzo
Hi pals, use strict; use warnings; my $foo = 'test'; my @bar = ( 'foo', '[%foo%]', 'bar' ); my @list = (); foreach my $x (@bar) { $x =~ s/^\[%([^%]+)%\]$/${$1}/g; print $x . " "; } -- ...it gives me compilation error: Can't use string ("foo") as a SCALAR ref while "strict refs"

Re: output to one changing line

2004-09-15 Thread JupiterHost.Net
Chris Devers wrote: On Wed, 15 Sep 2004, JupiterHost.Net wrote: Does the \r solution work on winders (I don't have any Winders computers) also? perl -e '$|=1; print "\rLine $_" and sleep 1 for 1..3; print "\n"' I've just successfully tested it on the Cygwin version of Perl, both cool, thanks! f

RE: output to one changing line

2004-09-15 Thread Tim Johnson
That doesn't work on my WinXP, but this does... perl -e "$|=1; print \"\rLine $_\" and sleep 1 for 1..3; print \"\n\"" -Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 15, 2004 2:03 PM To: [EMAIL PROTECTED] Subject: Re: output to one changing

Re: output to one changing line

2004-09-15 Thread Chris Devers
On Wed, 15 Sep 2004, JupiterHost.Net wrote: > Does the \r solution work on winders (I don't have any Winders computers) > also? > > perl -e '$|=1; print "\rLine $_" and sleep 1 for 1..3; print "\n"' I've just successfully tested it on the Cygwin version of Perl, both from a local DOS window and

Re: output to one changing line

2004-09-15 Thread JupiterHost.Net
I've seen a Damian Conway presentation where he faked out this behavior by prefixing all output with enough backspace ("\h") characters to wipe out the previous output and display a new line. I guess you mean \b, not \h :-) That must've been it then :) That does work for me under Win2k. Does the

Binary file and pack... What do I have now ?! Feeling lost...

2004-09-15 Thread Bee
First, I have to say thank you for those buddies that replies my thread on Conceptual question about pack. I just back from from vocation, so say howdy... For pack, I have do some more experiments, and I guess I could gereralize something... but that's quite a terrible founding, very far out of

RE: time managing

2004-09-15 Thread Jenda Krynicky
Repeat "please bottom post" ! From: "NandKishore.Sagi" <[EMAIL PROTECTED]> > What could be the problems associated with cron. I want to schedule a > job such that it runs say every 30 minutes or whatever time frame I > need. Cron does it superbly and that's what it is basically designed > to do. I

Re: output to one changing line

2004-09-15 Thread Jenda Krynicky
From: Chris Devers <[EMAIL PROTECTED]> > On Tue, 14 Sep 2004, JupiterHost.Net wrote: > > > I'd like the line to change as it runs, sort of an animated > > delivery: > > I've seen a Damian Conway presentation where he faked out this > behavior by prefixing all output with enough backspace ("\h") >

Re: building substrings

2004-09-15 Thread John W. Krahn
David Gilden wrote: Hello, Hello, I am building a primary key for a database, and I guess the first question would be how safe is a key made from the last 4 digits of a social security num and the first 3 letters of the last name. Do you mean safe as in unique? Or do you mean safe because you ar

Re: building substrings

2004-09-15 Thread Gunnar Hjalmarsson
David Gilden wrote: $ss = '1234567890'; $lname = 'Gilden'; # $pkey = substr($ss,length($ss)-4,length($ss)) . substr($lname,0,3); Why not just: $pkey = substr($ss, -4) . substr($lname,0,3); $ss = '09876543'; $lname = 'Smith'; # this line is bad! -- trying to have the same functionality as th

Re: building substrings

2004-09-15 Thread Wiggins d Anconia
> Hello, > > I am building a primary key for a database, and I guess the first question would be > how safe is a key made from the last 4 digits of a social security num and the first > 3 letters of the last name. I would guess not very, but I don't know what your target sample size is. I kn

RE: building substrings

2004-09-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
David Gilden wrote: > Hello, > > I am building a primary key for a database, and I guess the first > question would be > how safe is a key made from the last 4 digits of a social security > num and the first 3 letters of the last name. Now for the PERL > question, I have substr. line working cor

building substrings

2004-09-15 Thread David Gilden
Hello, I am building a primary key for a database, and I guess the first question would be how safe is a key made from the last 4 digits of a social security num and the first 3 letters of the last name. Now for the PERL question, I have substr. line working correctly. I wanted to try it with

Re: First module

2004-09-15 Thread Randal L. Schwartz
> "Colin" == Colin Johnstone <[EMAIL PROTECTED]> writes: Colin> my $class = ref($proto) || $proto; Please, no. See the last paragraphs of . -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECT

RE: time managing

2004-09-15 Thread NandKishore.Sagi
What could be the problems associated with cron. I want to schedule a job such that it runs say every 30 minutes or whatever time frame I need. Cron does it superbly and that's what it is basically designed to do. I don't say that I am a Unix guru and I might be missing something here. -Origin

Re: reading encrypted files

2004-09-15 Thread Wiggins d Anconia
> Hello together, > I want to use a perl-script with the Net::FTP-Package to transfer files over > the net. At this time I have only ftp, no ssh, no sftp. > Therefore I need a user and password for the ftp-access. Now the user and > password are hardcoded as strings ( as plain ascii ) in my scri

RE: time managing

2004-09-15 Thread Wiggins d Anconia
Please bottom post... > CRON the one and the best solution to all your problems. > I doubt cron will handle "all your problems"... > For example if you want to execute a job > /home/home_dir/abcxyz/getdata.pl every one hour here is what you do. > > (1.) At UNIX $ prompt do a crontab -e > (2.)

Re: time managing

2004-09-15 Thread Wiggins d Anconia
Please bottom post... > I am not a guru for Unix or Perl but i suppose u could to write a call > to a function that > * Pulls the job > * wait for an hour after every pull? maybe using something like wait()? > If anyone else could give a pointer on how to do the second point. > Would be great. > C

RE: time managing

2004-09-15 Thread Bob Showalter
Budi Santosa wrote: > Chris and Scott, > Thanks for your information. Unfortunately, I use > windows-based Komodo as my Perl platform. > Is there any cron function in this platform? Windows has an "at" scheduler that, frankly, sucks big time. Here's a perl cron for windows: http://cronw.sourcefor

RE: time managing

2004-09-15 Thread NandKishore.Sagi
CRON the one and the best solution to all your problems. For example if you want to execute a job /home/home_dir/abcxyz/getdata.pl every one hour here is what you do. (1.) At UNIX $ prompt do a crontab -e (2.) It opens a writable file (Mostly in "vi" unless ofcourse you have not changed nay setti

reading encrypted files

2004-09-15 Thread Christian Stalp
Hello together, I want to use a perl-script with the Net::FTP-Package to transfer files over the net. At this time I have only ftp, no ssh, no sftp. Therefore I need a user and password for the ftp-access. Now the user and password are hardcoded as strings ( as plain ascii ) in my script and thi

Re: time managing

2004-09-15 Thread Ishwor
I am not a guru for Unix or Perl but i suppose u could to write a call to a function that * Pulls the job * wait for an hour after every pull? maybe using something like wait()? If anyone else could give a pointer on how to do the second point. Would be great. Cheers On Wed, 15 Sep 2004 09:35:01 -

Re: time managing

2004-09-15 Thread Budi Santosa
Chris and Scott, Thanks for your information. Unfortunately, I use windows-based Komodo as my Perl platform. Is there any cron function in this platform? Budi --- Chris Devers <[EMAIL PROTECTED]> wrote: > On Wed, 15 Sep 2004, Budi Santosa wrote: > > > What do you mean with a cron job? > >

Re: time managing

2004-09-15 Thread Chris Devers
On Wed, 15 Sep 2004, Budi Santosa wrote: > What do you mean with a cron job? You're going to have to take some initiative to figure some of these things out with a search engine. Here's the first hit when you put "cron" into Google:

RE: time managing

2004-09-15 Thread NIPP, SCOTT V \(SBCSI\)
"cron" is a Unix utility for running commands in a scheduled manner. You configure the "job" for cron to run it every hour. This means that you never have to worry about the job running regularly because cron manages it. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web:

Re: time managing

2004-09-15 Thread Budi Santosa
Hi Chris, What do you mean with a cron job? thanks Budi --- Chris Devers <[EMAIL PROTECTED]> wrote: > On Wed, 15 Sep 2004, Budi Santosa wrote: > > > Does anybody know how to extract web content for > each > > hour during one day period? > > Write a script using LWP::Simple or other aspects of >

Re: perl software

2004-09-15 Thread Chris Devers
On Wed, 15 Sep 2004, Lung, Peter wrote: > I am running XP on my notebook. > > What version of Perl must I install. The common versions seem to be the ones provided by Activestate or Cygwin; Activestate's Perl seems to have a better reputation.

Re: output to one changing line

2004-09-15 Thread JupiterHost.Net
Does that make sense :) ?? Yes. Just print a \r to move the cursor back to the beginning of the line. perl -e '$|=1; print "\rLine $_" and sleep 1 for 1..3; print "\n"' Nice, that does it perfectly, thanks Bob for the \r Thanks also to Chris for the same idea but different character :) Have a gdoo

perl software

2004-09-15 Thread Lung, Peter
Hi, I am running XP on my notebook. What version of Perl must I install. What other additional software do I need to install. Where do I get the software from... Regards, Peter -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: output to one changing line

2004-09-15 Thread Bob Showalter
JupiterHost.Net wrote: > Hello list, > > I've seen this done, but am not sure what its called or where to start > looking... > > Instead of the output of a script via CLI being: > > # perl script.pl > line1 > line2 > line3 > etc > # > > I'd like the line to change as it runs, sort of an animate

Re: How to extract the exact URL

2004-09-15 Thread Ing. Branislav Gerzo
Chris Devers [CD], on Wednesday, September 15, 2004 at 07:31 (-0400 (EDT)) wrote: >> if ( $line =~ /href="([^")">2 Typo? That bracket is unbalanced. Try this: CD> if ( $line =~ /href="([^"]+)">22http://learn.perl.org/>

Re: OPEN command in Perl

2004-09-15 Thread Sheni R. Meledath
Hi Chris, Sorry to post the same message in two lists. I was not sure about where to post this query. Thank you very much for the valuable information. Shall try & revert. At 04:11 PM 9/15/2004, you wrote: On Wed, 15 Sep 2004, Sheni R. Meledath wrote: > How can I open an external file using Perl

Re: time managing

2004-09-15 Thread Chris Devers
On Wed, 15 Sep 2004, Budi Santosa wrote: > Does anybody know how to extract web content for each > hour during one day period? Write a script using LWP::Simple or other aspects of LWP. Make sure it does what you want. Then install it as a cron job meant to run once an hour. -- Chris Devers

OPEN command in Perl

2004-09-15 Thread Sheni R. Meledath
Hi, How can I open an external file using Perl? The file is residing on another server. I have to call the file using http. Now the following is not working. $email_file = "http://www.mysite.com/data/emails";; open (LIST,"<$email_file/address.txt"); Thanks in advance. Regards Sheni R Meledath [EM

Re: OPEN command in Perl

2004-09-15 Thread Chris Devers
On Wed, 15 Sep 2004, Sheni R. Meledath wrote: > How can I open an external file using Perl? The file is residing on another > server. I have to call the file using http. Now the following is not working. > > $email_file = "http://www.mysite.com/data/emails";; > open (LIST,"<$email_file/address.tx

time managing

2004-09-15 Thread Budi Santosa
Hi, Does anybody know how to extract web content for each hour during one day period? thanks Budi __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED

OPEN command in Perl

2004-09-15 Thread Sheni R. Meledath
Hi, How can I open an external file using Perl? The file is residing on another server. I have to call the file using http. Now the following is not working. $email_file = "http://www.mysite.com/data/emails";; open (LIST,"<$email_file/address.txt"); Thanks in advance. Regards Sheni R Meledath [EM

Re: How to skip all tests while using CPAN

2004-09-15 Thread Chris Devers
On Wed, 15 Sep 2004, Ramprasad A Padmanabhan wrote: > I am installing some perlmodules using CPAN on commandline. Since I am > doing this on multiple machines of the same architecture , I want to > avoid "make tests" in CPAN , how can I do this ? If you're trying to install the same thing on mul

Re: How to extract the exact URL

2004-09-15 Thread Chris Devers
On Wed, 15 Sep 2004, Ing. Branislav Gerzo wrote: > but why is yout regexp so difficult ? what about this ? > > if ( $line =~ /href="([^")">222 but not anything like bar That isn't what you mwant, is it? If you're trying to extract the url, you shouldn't have to put it in an if statement

Re: How to extract the exact URL

2004-09-15 Thread Ing. Branislav Gerzo
Franklin Zhang [FZ], on Wednesday, September 15, 2004 at 11:20 (+0800) wrote these comments: FZ> Now, there are three kind of URL that I want to extract: FZ> 1. href="/Archives/1190192/000101968704002050/0001019687-04-002050-index.htm">2 FZ> 2. href="/Archives/1190192/000101968704002050/0001019

Re: declaring with my

2004-09-15 Thread Gunnar Hjalmarsson
Gunnar Hjalmarsson wrote: Suppose the fact that it doesn't contain the values from the last line proves that my theory is not the whole truth... OTOH, you can study the impact of my() through these examples: my @array; for (1..3) { push @array, $_; print "@array\n"; } Ou

Re: declaring with my

2004-09-15 Thread Gunnar Hjalmarsson
Errin Larsen wrote: Gunnar Hjalmarsson wrote: Because the push() statement is in a loop, and my() would empty the variable at each iteration. push my @numbers, split while <>; foreach (sort { $a <=> $b } @numbers) { printf "%20g\n", $_; } This code produces no output ... not even any warnings or

Re: CC mit Mailprog funktioniert nicht

2004-09-15 Thread Jan Eden
Hallo Reinhold, Reinhold Riedersberger wrote on 10.09.2004: >Hallo , > >ich habe ein für mich seltsames Problem: > >Mit dem untenstehenden Programmteil habe ich früher (meine ich >zumindest) erfolgreich eMails nebst CC versendet. Seit mir unbekannter >Zeit wird aber nur noch der To-Empfänger amg

Re: How to extract the exact URL

2004-09-15 Thread Gunnar Hjalmarsson
Franklin Zhang wrote: Now, there are three kind of URL that I want to extract: 1. href="/Archives/1190192/000101968704002050/0001019687-04-002050-index.htm">2 2. href="/Archives/1190192/000101968704002050/0001019687-04-002050-index.htm">2abcd 2. href="/Archives/1190192/000101968704002050/0001019687