RE: printing elements of an array

2003-08-28 Thread Joshua Lokken
Excellent, thanks. I wonder, though, the book I'm using, Perl by Example, says that print individual elements of an array, @name, to use scalars, eg. $name[1], $name[2], etc. While your way is much easier and works well, I wonder why my original syntax did not produce the desired result? Joshua

RE: Graphing/Plotting over time

2003-08-28 Thread Dan Muey
> --On Thursday, August 28, 2003 3:19 PM -0400 Chuck Fox > <[EMAIL PROTECTED]> > wrote: > > > What about using perl to massage the data into a file (or hash) and > > then using gnuplot ( or Graph::Plot ) > > Nothing wrong with that at all. I was just pointing out that > there is > alreadyt

Re: Graphing/Plotting over time

2003-08-28 Thread David Wall
--On Thursday, August 28, 2003 3:19 PM -0400 Chuck Fox <[EMAIL PROTECTED]> wrote: What about using perl to massage the data into a file (or hash) and then using gnuplot ( or Graph::Plot ) Nothing wrong with that at all. I was just pointing out that there is alreadyt software written for stati

Re: why this is not working ??

2003-08-28 Thread John W. Krahn
Jeff Westman wrote: > > --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > > > > open(STATUS,">>status.txt");for($i=0;$i<=98985;$i++){system("process");if(($i%10)==0){print(STATUS"\n\n > > $i iterations over !!*\n\n")}}close(STATUS); > > > > However that is

count tuples for Oracle?

2003-08-28 Thread Johnson, Shaunn
Howdy: With the PostgreSQL DBI, you can get a number of tuples (with ntuples) from some previously SQL query. For example, I have : [snip] use Pg; . . . sub getcols { my($table)[EMAIL PROTECTED]; return doquery('find rows'," SELECT a1.attname, a1.attnotnull, a1.attnum, t.typname, a1.

Re: new to perl

2003-08-28 Thread Chuck Fox
Shirley, I do almost the exact same thing in my database dump script. Here is the function that I use to remove older dump files. HTH, Chuck Fox ### Prune Dumps Subroutine ### ### Description: ### This subroutine will rem

Re: -w vs. use warnings

2003-08-28 Thread Jenda Krynicky
From: Morbus Iff <[EMAIL PROTECTED]> > As for $|++, there was a recent debate (on Perlmonks.com, I believe) > on how $|=1 may be a better visual choice than $|++. I haven't made up > my mind either way - I still use ++ in my own scripts. Unfortunately, > I couldn't find the Perlmonks.com link, so I

RE: printing elements of an array

2003-08-28 Thread Dan Muey
> > Hello Howdy > > > > This should be very straightforward: > > > > print "Enter 5 of your favorite foods: "; > > $favorites = ( ); [snip] > > > > The desired output would be: > > > > food1 food2 food3 food4 food5 > > > > food1 > > food2 > > food3 > > food4 > > food5 > > > > > > Can so

Re: Length() is bits/bytes or neither

2003-08-28 Thread david
Zsdc wrote: > david wrote: > >> Zsdc wrote: >> >>>#!/usr/bin/perl -wl >>>use utf8; >>>sub bytes ($) { >>>use bytes; >>>length $_[0]; >>>} >>>$x = chr 123456; >>>print length $x, " chars"; >>>print bytes $x, " bytes"; >> >> you don't need to write your

Fw: printing elements of an array

2003-08-28 Thread Joshua Lokken
- Original Message - From: "Jolok" <[EMAIL PROTECTED]> Newsgroups: perl.beginners Sent: Thursday, August 28, 2003 11:24 AM Subject: printing elements of an array > Hello > > This should be very straightforward: > > print "Enter 5 of your favorite foods: "; > $favorites = ( ); > @food

Re: why this is not working ??

2003-08-28 Thread Jeff Westman
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > > On Wed, Aug 27, 2003 at 11:18:26AM +0530, T.S.Ravi Shankar wrote: > > > > > > open(STATUS,">> status.txt"); > > > for ($i=0; $i<=98985;$i++) { > > > system ("process"); > > > if (($i%10)==0) > > > { print ST

Re: -w vs. use warnings

2003-08-28 Thread John W. Krahn
K Old wrote: > > Hello everyone, Hello, > Having been a Perl programmer for several years now I have become > accustom to using the following as my normal "start" of any Perl script: > > #!/usr/bin/perl > use warnings; > use strict; > > Randal Schwartz uses this: > > #!/usr/bin/perl -w >

Re: Length() is bits/bytes or neither

2003-08-28 Thread zsdc
david wrote: Zsdc wrote: #!/usr/bin/perl -wl use utf8; sub bytes ($) { use bytes; length $_[0]; } $x = chr 123456; print length $x, " chars"; print bytes $x, " bytes"; you don't need to write your own function to force byte semantics when you feed a utf8 string

RE: new to perl

2003-08-28 Thread Paul Kraus
opendir (DH,"server\\path"); foreach (readdir ){ if (/\.trn/){ unlink($_) or warn "file $_ not deleted $!\n"; } } Untested. HTH Paul -Original Message- From: Shirley Wiederholt [mailto:[EMAIL PROTECTED] Sent: Thursday, August 28, 2003 4:40 PM To: [EMAIL PROTE

Re: -w vs. use warnings

2003-08-28 Thread Tassilo von Parseval
On Thu, Aug 28, 2003 at 04:17:21PM -0400 K Old wrote: > Having been a Perl programmer for several years now I have become > accustom to using the following as my normal "start" of any Perl script: > > #!/usr/bin/perl > use warnings; > use strict; > > Randal Schwartz uses this: > > #!/usr/bi

new to perl

2003-08-28 Thread Shirley Wiederholt
Hi, This is my first email to beginner's Perl and sincerely hope I am sending this message to the right place. I want to delete some DB backup files using UNC pathing and perl. My code segment, which does not work, is listed below. I do not get any errors when I run this piece of code howeve

RE: -w vs. use warnings

2003-08-28 Thread wiggins
On 28 Aug 2003 16:17:21 -0400, K Old <[EMAIL PROTECTED]> wrote: > Hello everyone, > > Having been a Perl programmer for several years now I have become > accustom to using the following as my normal "start" of any Perl script: > > #!/usr/bin/perl

Re: -w vs. use warnings

2003-08-28 Thread Morbus Iff
>Having been a Perl programmer for several years now I have become >accustom to using the following as my normal "start" of any Perl script: > >#!/usr/bin/perl >use warnings; >use strict; > >Randal Schwartz uses this: > >#!/usr/bin/perl -w >use strict; >$|++; > >Is there any difference

Fw: newbie: printing elements of an array

2003-08-28 Thread Joshua Lokken
- Original Message - From: "Jolok" <[EMAIL PROTECTED]> Newsgroups: perl.beginners Sent: Thursday, August 28, 2003 1:19 PM Subject: newbie: printing elements of an array > > Hello > > > > This _should_ be very straightforward: > > > > print "Enter 5 of your favorite foods: "; > > $favori

-w vs. use warnings

2003-08-28 Thread K Old
Hello everyone, Having been a Perl programmer for several years now I have become accustom to using the following as my normal "start" of any Perl script: #!/usr/bin/perl use warnings; use strict; Randal Schwartz uses this: #!/usr/bin/perl -w use strict; $|++; Is there any differen

Re: Help on file manipulation

2003-08-28 Thread zsdc
Silja Rajendran wrote: I am a unix admin tasked with writing script for synchronizing the password between two servers. I though it can be done better using perl and hence this question. http://search.cpan.org/search?query=passwd&mode=module http://search.cpan.org/search?query=shadow&mode=module P

Re: File::Find

2003-08-28 Thread K Old
On Thu, 2003-08-28 at 15:16, Harter, Douglas wrote: > I want to traverse a directory tree, find all files using a specific pattern > (like *.tmp), and then if the modification age (-M) is over a certain limit, > delete it. > > File::Find looks like it would be good for that, but the man page gives

RE: File::Find

2003-08-28 Thread Bob Showalter
Harter, Douglas wrote: > I want to traverse a directory tree, find all files using a > specific pattern > (like *.tmp), and then if the modification age (-M) is over a certain > limit, delete it. > > File::Find looks like it would be good for that, but the man > page gives no > real examples. Ther

Re: Perl & XML

2003-08-28 Thread Chuck Fox
Joe, Try XML::Writer Chuck [EMAIL PROTECTED] wrote: I'm beginning my studies of XML and am looking for a Perl module(s) that allows me to be able to dynamically generate the XML along with any data and display it on the fly, as I now do with HTML. What I've seen so far seems to require writing

Re: Graphing/Plotting over time

2003-08-28 Thread Chuck Fox
What about using perl to massage the data into a file (or hash) and then using gnuplot ( or Graph::Plot ) Chuck [EMAIL PROTECTED] wrote: --On Wednesday, August 27, 2003 1:29 PM -0500 "Akens, Anthony" <[EMAIL PROTECTED]> wrote: Just wanted to look into a "for fun" project, after a recent pro

File::Find

2003-08-28 Thread Harter, Douglas
I want to traverse a directory tree, find all files using a specific pattern (like *.tmp), and then if the modification age (-M) is over a certain limit, delete it. File::Find looks like it would be good for that, but the man page gives no real examples. There is a reference to a pfind script on C

Re: sending interrupt

2003-08-28 Thread denis
On Thu, 28 Aug 2003, Ramprasad A Padmanabhan wrote: > Sharad Gupta wrote: > > Hi all, > > > > Any ideas on how do i send an interrupt signal to the connection made via > > Net::Telnet. > > > > Thanx, > > -Sharad > > > Which OS? > On Unix like systems, You can find the PID of the script

Help on file manipulation

2003-08-28 Thread Silja Rajendran
Hi, I am a unix admin tasked with writing script for synchronizing the password between two servers. I though it can be done better using perl and hence this question. the following is the description : 1. shadow1 - /etc/shadow file from first server 2. shadow2 - /etc/shadow file from second serv

RE: Length() is bits/bytes or neither

2003-08-28 Thread Dan Muey
Just for anyone interested :: Whilst looking at the modules some others suggested for helping find the bits/bytes of a string I ran across this simple, built in (I think - b module ??) way to find how many bits a string is: my $bit_count = unpack("%32b*",$string); I think it works pretty well

RE: grep with ftp

2003-08-28 Thread Dan Muey
> Howdy: Howdy > > I'm looking for information that will let me > open an ftp connection and grep / search > for files and then FTP them back to me. > Yout can use the ls function to get an array of file names in that folder and grep the names. Unless you have a unique ftp server on the rem

Re: Length() is bits/bytes or neither

2003-08-28 Thread david
Zsdc wrote: > In my post from 2003-08-26 Re: Length() is bits/bytes or neither > (Message-ID: <[EMAIL PROTECTED]>) I wrote some code illustrating > this issue but without any comments. Anyway, I wrote a function bytes() > which counts bytes in UTF-8 strings: > > #!/usr/bin/perl -wl > use

RE: WIN32 Shortcut using perl

2003-08-28 Thread Dan Muey
> Hello Colleagues, Howdy. > > I am looking for the solution where i can create a > shortcut of the folder/file using WIN32 Shortcut/thr > someother means using perl language on windows. > > Can anybody help me to find a solution on this? I don't do much in a WinBlows Environment but I'm su

RE: grep with ftp

2003-08-28 Thread Bob Showalter
Johnson, Shaunn wrote: > Howdy: > > I'm looking for information that will let me > open an ftp connection and grep / search > for files and then FTP them back to me. What do you mean "grep/search" for files? If you want to search for particular file *names*, Net::FTP can return a list of files an

WIN32 Shortcut using perl

2003-08-28 Thread thyagarajan k
Hello Colleagues, I am looking for the solution where i can create a shortcut of the folder/file using WIN32 Shortcut/thr someother means using perl language on windows. Can anybody help me to find a solution on this? __ Do you Yahoo!? Yahoo! SiteBuilder - Free,

Re: grep with ftp

2003-08-28 Thread Jeff 'japhy' Pinyan
On Aug 28, K Old said: >@filelist = grep{/[e|f][d|m|v|s].ic$/} $ftp->ls($path); You probably means @filelist = grep { /[ef][dmvs]\.ic$/ } $ftp->ls($path); since character classes don't use | for alternation, and . is a metacharacter in a regex. -- Jeff "japhy" Pinyan [EMAIL PROTECTED]

Re : Installing CPAN Perl Modules with Activestate Perl 5. v5.8

2003-08-28 Thread Derek Byrne
Hi, In the process of trying to get perl modules installed, I downloaded over 300 Activestate specific perl modules and they work fine (of the ones I've used). Now, I've read somewhere that the perl modules which are located on CPAN are not directly compatible with ActiveState's version of Perl

Re: grep with ftp

2003-08-28 Thread K Old
On Thu, 2003-08-28 at 10:34, Johnson, Shaunn wrote: > Howdy: > > I'm looking for information that will let me > open an ftp connection and grep / search > for files and then FTP them back to me. > > I saw something about FTP and macros, but > the other articles about Net::FTP got me to > believ

RE: grep with ftp

2003-08-28 Thread Hanson, Rob
> Is this possible? I'm no expert of FTP software, so I can't say if that is generally possible, but it will depend on what the FTP server software allows you to do. So I would start there, find out what software they are running, then find some documentation on it. Rob -Original Message---

Re: nested parenthesis in regex and launching a new process

2003-08-28 Thread zsdc
Bryan Harris wrote: The fork concept can be quite confusing at first, but it is actually quite simple, once you get used to it. Check out the output of this little program: [ very interesting stuff cut out ] Wild! Why would anyone ever use this? Why would you ever want to clone yourself at the

RE: Simulating VB Enum

2003-08-28 Thread Dan Muey
Not a vb person myself but would a hash do that then: my %enum = ( ASSET => 1, LIABILITY => 2, EQUITY => 3, REVENUE => 4, EXPENSE => 5, DIVIDEND => 6, CONTRA_ASSET => 11, ); Or is Vb's enum like mysql's enum? I ask since you where doing a select and I don't know if that is a

grep with ftp

2003-08-28 Thread Johnson, Shaunn
Howdy: I'm looking for information that will let me open an ftp connection and grep / search for files and then FTP them back to me. I saw something about FTP and macros, but the other articles about Net::FTP got me to believe you can do this with Perl. If so, is Net::FTP the route the go? Is

RE: Perl Codes Written in Windows Env

2003-08-28 Thread Dan Muey
hallo world iam new at perl > i preseneted the problem below, > my news scripts still can't run. > My server is not configured to use ssi > it reguires cgi extensions > my script executable/permissions are ok > When i run the cgi extension scripts in the browser they are not running(Interna

RE: Perl & XML

2003-08-28 Thread wiggins
On 28 Aug 2003 07:13:38 -0500, Joe Mecklin <[EMAIL PROTECTED]> wrote: > I'm beginning my studies of XML and am looking for a Perl module(s) that > allows me to be able to dynamically generate the XML along with any data > and display it on the fly,

Perl & XML

2003-08-28 Thread Joe Mecklin
I'm beginning my studies of XML and am looking for a Perl module(s) that allows me to be able to dynamically generate the XML along with any data and display it on the fly, as I now do with HTML. What I've seen so far seems to require writing the XML and associated data to an external file - an ad

Re: Length() is bits/bytes or neither

2003-08-28 Thread zsdc
patrick hall wrote: Unicode can get pretty hairy, but it's my impression that the number of bytes per character varies depending on your encoding. UTF-8, the defacto standard nowadays, has variable length encoding -- characters can take between 3 and 6 bytes, if I recall correctly. [...] Sure enou

while loop

2003-08-28 Thread Ronen Kfir
Hi, Newbie question... This script delete logs on remote machine mapped to drive "z:", based on "disk is above %x of capacity. use strict; use warnings; use Win32::AdminMisc; my $drive="z:"; my ($Total, $Free) = Win32::AdminMisc::GetDriveSpace ( $drive ); my @Out = `dir $drive`; (my

RE: Perl Codes Written in Windows Env

2003-08-28 Thread SiyandaK
hallo world iam new at perl i preseneted the problem below, my news scripts still can't run. My server is not configured to use ssi it reguires cgi extensions my script executable/permissions are ok When i run the cgi extension scripts in the browser they are not running(Internal Server Error Th

Re: why this is not working ??

2003-08-28 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > On Wed, Aug 27, 2003 at 11:18:26AM +0530, T.S.Ravi Shankar wrote: > > > > open(STATUS,">> status.txt"); > > for ($i=0; $i<=98985;$i++) { > > system ("process"); > > if (($i%10)==0) > > { print STATUS "\n\n $i iterations over !!*\n\n"; } > > } > > clo

Re: 012 and 015 eq \r and\n on what conversion chart?

2003-08-28 Thread John W. Krahn
Trina Espinoza wrote: > > tr/\012\015//d; > > So a while back ago, there was someone kind enough to pass me the > above snippet of code, which removes returns and newlines from data > attained by perl. It works great and I would like to find the > conversion table that was used so I can obtain th

Re: why this is not working ??

2003-08-28 Thread jqdkf
On Wed, Aug 27, 2003 at 11:18:26AM +0530, T.S.Ravi Shankar wrote: > --- > > open(STATUS,">> status.txt"); > for ($i=0; $i<=98985;$i++) { > system ("process"); > if (($i%10)==0) > { print STATUS "\n\n $i iterations over !!*\n\n"; } > } > close(STATUS); > > -

RE: DynaLoader with nonstandard lib location

2003-08-28 Thread NYIMI Jose (BMB)
May be LD_LIBRARY_PATH (environment variable) setting problem. Try to add your "external C library" in it before running your perl script. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lwire/perllib/clib HTH, José. -Original Message- From: Reid Beels [mailto:[EMAIL PROTECTED] Sent: Th

Re: DynaLoader with nonstandard lib location

2003-08-28 Thread Tassilo von Parseval
On Wed, Aug 27, 2003 at 06:00:40PM -0700 Reid Beels wrote: > I'm trying to install a module (Image::Imlib2) which depends on > DynaLoader being able to find an external C library. Normally, this > wouldn't cause a problem but I'm being forced to install the module on > a system which I do n

Re: nested parenthesis in regex and launching a new process

2003-08-28 Thread Bryan Harris
> The fork concept can be quite confusing at first, but it is actually > quite simple, once you get used to it. Check out the output of this > little program: [ very interesting stuff cut out ] Wild! Why would anyone ever use this? Why would you ever want to clone yourself at the current poin

Re: sending interrupt

2003-08-28 Thread Ramprasad A Padmanabhan
Sharad Gupta wrote: Hi all, Any ideas on how do i send an interrupt signal to the connection made via Net::Telnet. Thanx, -Sharad Which OS? On Unix like systems, You can find the PID of the script and send the signal on the shell like kill -15 $PID Ram -- To unsubscribe, e-mail: [EMAIL PROT

RE: Length() is bits/bytes or neither

2003-08-28 Thread patrick hall
Hi, > length() returns the length in characters, which > for ASCII is also the number of bytes. To get > the bits, just multiply by 8. > If you are using a Unicode character set > instead, I'm not too sure what will be returned, > or how you can convert it to bits. Unicode can get pretty hairy,

Re: Graphing/Plotting over time

2003-08-28 Thread David Wall
--On Wednesday, August 27, 2003 1:29 PM -0500 "Akens, Anthony" <[EMAIL PROTECTED]> wrote: Just wanted to look into a "for fun" project, after a recent project that wasn't much fun at all... Our organization got hit by the blaster worm, which hit many, many windows boxes. The *nix boxes (which

DynaLoader with nonstandard lib location

2003-08-28 Thread Reid Beels
I'm trying to install a module (Image::Imlib2) which depends on DynaLoader being able to find an external C library. Normally, this wouldn't cause a problem but I'm being forced to install the module on a system which I do not have root access on and thus must store the both the module and

Re: Simulating VB Enum

2003-08-28 Thread R. Joseph Newton
Dan Muey wrote: > In addtion to Rob's very sound advice it sound like you simply need an array: > > my @enum = qw(dhbold dhcaption dhend dhform); > > print $enum[0]; # prints dhbold > print $enum[2]; # prints dbhend > > HTH > > DMuey Sorry Dan, I dn't think so. That usage actually goes in the w