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
> --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
--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
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
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.
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
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
> > 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
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
- 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
--- "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
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
>
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
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
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
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
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
>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
- 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
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
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
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
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
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
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
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
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
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
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
> 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
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
> 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
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
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,
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]
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
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
> 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---
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
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
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
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
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,
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
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
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
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
[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
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
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);
>
> -
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
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
> 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
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
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,
--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
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
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
58 matches
Mail list logo