Amarnath Honnavalli Anantharamaiah asks ..
How do I get help on some modules like what are services available in
particular module say NET::FTP etc etc
all command-line distributions of Perl ship with a utility called perldoc ..
for modules like Net::FTP you should be able to type the
Amarnath Honnavalli Anantharamaiah asks ..
How do I get help on some modules like what are services available in
particular module say NET::FTP etc etc
all command-line distributions of Perl ship with a utility called perldoc ..
for modules like Net::FTP you should be able to type the
you have no Net::Ftp module, you can download and install it,
then you can use
perldoc Net::FTP
to see the document.
-原始邮件-
发件人: Amarnath Honnavalli Anantharamaiah
[mailto:[EMAIL PROTECTED]]
发送时间: 2001年4月24日 15:07
收件人: King Jason; [EMAIL PROTECTED]
主题: RE: Perl
Thanks for the range operator idea.
-Original Message-
From: King, Jason [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 23, 2001 4:29 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject:RE: Another regular expression question?
Amarnath's code sample below can be
Hi James,
I'm a great believer in learning by doing, so here's a few pointers for
you to start with.
have a look at opendir, closedir and readdir for the directory access
have a look at time and stat to get/compare timestamps
all are documented in the 'man perlfunc' man page
Gary
On Tuesday
: if ((($amounts{$cheque}) - $amount) != 0) {
:
: $sth1-execute(split/,/)
: }
:
: ...
:
: However the $sth1-execute(split/,/) is giving me all the fields from the
: original file (when I only want 2) and I get
All,
I 've an output from the system comand as follows.
* /xxx/ /yyy/
* /www/ /vvv/
* /uuu/ /ttt/
:::
I want to parse this output into an array and split them and process each
entry. Essentially, I want to parse the output of a command to an
And for those with embedded JavaScript to write, in which you already
have too many quotes: =o)
printEND;
Here, put whatever text you 'like'.
The quotes are handled.
By default, $everything is treated as if it had around it,
but you can still use . $vars will be expanded to
Another possible solution is to use Brian Ingerson's Inline.pm and code
the reads c. with C's lower level IO. I think a C getc() would do
it
But be warned that, while it's actually quite friendly, a raw beginner
might have some trouble with the Inline stuff, especially if they don't
know C.
[EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
snippage
My code is
my @vob_list = system (cleartool lsvob) ;
foreach $entry (@vob_list) {
print This is first '$entry' ;
}
use 'perldoc perlop' and look for 'qx'. The system call doesn't catch
the output of the called program. For this
: I 've an output from the system comand as follows.
:
: * /xxx/ /yyy/
: * /www/ /vvv/
: * /uuu/ /ttt/
: :::
:
: I want to parse this output into an array and split them and process each
: entry. Essentially, I want to parse the output of a
so...this is suposed to count the words in FILE and return how many occourances of
each word there were...its not working for me thoughits only returning the count
for the last word in the file...help
#!/usr/local/bin/perl
open (FILE,../www/main.php3);
@lines=FILE;
close(FILE);
foreach
--- Sean O'Leary [EMAIL PROTECTED] wrote:
At 09:57 AM 4/24/2001, you wrote:
And I almost forgot to send this to the list!
See? lol
See how useful that Reply-To can be? : )
Sean.
Even more than you think -- I mistyped the address on the CC: to the
list, and it bounced back!
On Tue, Apr 24, 2001 at 10:56:53AM -0500, Chris Brown wrote:
: i have done some cgi stuff like a guestbook and a script to display random images
:but i wanted to get deeper so i thought i would try this...im not in any classes...i
:guess you could call it personal homework...but its not really
its no deal man...i got it to work...thanks a ton for the help you guys. Im
sure it wont be long until next time.
Chris Brown
At 11:17 AM 4/24/2001, you wrote:
so...this is suposed to count the words in FILE and return how many
occourances of each word there were...its not working for me thoughits
only returning the count for the last word in the file...help
#!/usr/local/bin/perl
open (FILE,../www/main.php3);
--- Chris Brown [EMAIL PROTECTED] wrote:
so...this is suposed to count the words in FILE and return how many
occourances of each word there were...its not working for me
thoughits only returning the count for the last word in the
file...help
#!/usr/local/bin/perl
open
Go to
http://www.perl.com/
and click on the Download link in nav bar on the left-hand side of the
screen. Then read the instructions.
Saritha_Vinod wrote:
Hi
Kindly advice me how to install Perl Software in the below Operating
Systems:
1. Linux
2. Windows 98
Thanks,
SV
On Tue, Apr 24, 2001 at 11:26:59AM -0500, Collins, Eric S. wrote:
: How do I remove this mailing list from my account? This e-mail account can't
: receive the massive amounts of mail which this list generates.
I'm sorry to hear that.
http://lists.perl.org/showlist.cgi?name=beginners
--
Casey
When subscribing to a new group, it's good practice to hang on to the
welcome to the group email that the list server sends you with all the
useful information, like how to unsubscribe. In any case, here's what mine
says:
To remove your address from the list, just send a message to
the
Hi, folks ...
I'm generating a list of files (from a find subroutine) and putting
them in an array. The list looks like ...
/home4/dsadmin/7790/DocuShare/documents/b003/File-11523.1
/home4/dsadmin/7790/DocuShare/documents/b003/File-11587.1
Hi Chris,
You are getting only the last line of the file because of this:
foreach $i (@lines) {
@words = split(/\s+/, $i);
}
You reassign the @words array each time, and end up with the last line only
when exiting the foreach loop. You may want to look at 'perldoc -f push' to see
how to add
Could someone tell me why this is happening? When I use this command, it
used to give me 20010405.doc (mmdd.doc), now it's giving me 2001 4 5.doc
- I'm losing the leading zeros.
Command is on Perl 5 - printf(\%s%02s%02s.doc,$year,$month,$day).
Thanks.
Just use the basename() method from File::Basename;
# perl -MFile::Basename -e 'print basename(/tmp/foo/003/File-11523.1)';
File-11523.1
Cheers,
Kevin
On Tue, Apr 24, 2001 at 09:52:04AM -0700, Sandor W. Sklar ([EMAIL PROTECTED])
spew-ed forth:
Hi, folks ...
I'm generating a list of files
I've done this several ways, depending on my mood.
1.
@path = split(/\//, $file);
$filename = $path[$#path];
2.
$filename = $1 if ($file =~ m|/([^/]+)$|);
3.
use File::Basename;
$filename = basename($file);
1 uses split and $#array, which can be nasty if someone set $[ to something
other
On Tue, Apr 24, 2001 at 09:52:04AM -0700, Sandor W. Sklar wrote:
: Hi, folks ...
:
: I'm generating a list of files (from a find subroutine) and putting
: them in an array. The list looks like ...
:
: /home4/dsadmin/7790/DocuShare/documents/b003/File-11523.1
:
On Tue, Apr 24, 2001 at 11:00:40AM -0500, Arante, Susan wrote:
: Could someone tell me why this is happening? When I use this command, it
: used to give me 20010405.doc (mmdd.doc), now it's giving me 2001 4 5.doc
: - I'm losing the leading zeros.
: Command is on Perl 5 -
Hi Susan,
I get what you expect:
perl -wle '$y=2001;$m=4;$d=5;printf(\%s%02s%02s.doc,$y,$m,$d)';
20010405.doc
Personally, I like POSIX.pm for dates.
# perl -MPOSIX -wle 'print strftime(%Y%m%d, localtime) . .doc';
20010424.doc
'perldoc POSIX' to learn more (look for strftime).
Cheers,
Kevin
Sandor W. Sklar ([EMAIL PROTECTED]) wrote:
Hi, folks ...
I'm generating a list of files (from a find subroutine) and putting
them in an array. The list looks like ...
/home4/dsadmin/7790/DocuShare/documents/b003/File-11523.1
/home4/dsadmin/7790/DocuShare/documents/b003/File-11587.1
: Help on Date Format
Hi Susan,
I get what you expect:
perl -wle '$y=2001;$m=4;$d=5;printf(\%s%02s%02s.doc,$y,$m,$d)';
20010405.doc
Personally, I like POSIX.pm for dates.
# perl -MPOSIX -wle 'print strftime(%Y%m%d, localtime) . .doc';
20010424.doc
'perldoc POSIX' to learn more (look for strftime
On Tue, Apr 24, 2001 at 01:09:13PM -0400, Kevin Meltzer wrote:
Hi Susan,
I get what you expect:
perl -wle '$y=2001;$m=4;$d=5;printf(\%s%02s%02s.doc,$y,$m,$d)';
20010405.doc
[snip]
Well I'll be damned.
[ ~ ] perl -e 'printf %04s\n, 1'
0001
[ ~ ] perl -e 'printf %04s\n, 1'
0001
[ ~ ]
Kevin Meltzer ([EMAIL PROTECTED]) wrote:
Just use the basename() method from File::Basename;
# perl -MFile::Basename -e 'print basename(/tmp/foo/003/File-11523.1)';
File-11523.1
That won't help him with this line:
/home4/dsadmin/7790/DocuShare/documents/b004/File-1156/html/main.htm
--- [EMAIL PROTECTED] wrote:
I thought I was improving at expressions but this one has me stumped:
I have text interspersed with numbers. The text can be anything,
including all types of punctuation marks.
Well let me give an example:
The Text has numbers in it apparently-1.0 at
Ahh yes.. I didn't go down all the examples.. once he said he wanted to use
File::Basename I wouldn't think he wanted anything put the end. Now he knows
how to get the basename as well ;)
Cheers,
Kevin
On Tue, Apr 24, 2001 at 07:19:02PM +0200, Michael Lamertz
([EMAIL PROTECTED]) spew-ed forth:
In this case, it wont really matter. Since 1 and 1 is essentially the same.
If you were actually using a signed integer (in decimal), then you would see
the difference:
From perldoc -f sprintf:
%s a string
%d a signed integer, in decimal
[root@fluffhead /]# perl -e 'printf %04s\n,
Slight correction to my last post:
: my $float_re = qr{
:
: \d+\.\d+ # Matches 2.3
: | \d+\. # Matches 2.
: |\.=d+ # Matches .2
: | \d+ # Matches 2
:
: }x; # x means extended regex syntax
In the third line of the first regex, = should be \.
-- tdk
Hi ,
Is there any one who can help me make a randon numer generator
Any help will be appreciated.
Thanks
Sushil Prabhakar
Cybernet Communications Inc.
Suite 207
20 Amber Street
Markham, Ontario
L3R 5P4
Tel: (905) 947 1801
Fax:(905) 947 1802
Hi Rajakumar,
It may be helpful if we knew what failed in the installation of the
DBD::Oracle module. IMO, it would be better to fix that problem than copy over
another perl installation.
However, you can change what is in @INC if you want to try that. You can:
use lib qw(/some/path
Hi Sushil,
perldoc -f rand
You can also look at the Math::Random and Math::TrulyRandom modules on the
CPAN.
Cheers,
Kevin
On Tue, Apr 24, 2001 at 02:58:16PM -0700, sushil ([EMAIL PROTECTED]) spew-ed forth:
Hi ,
Is there any one who can help me make a randon numer generator
Any help will
Thank you very much for all the great help I received earlier on extracting
numbers from text. There is only one thing I forgot about:
Some of the files have HTML headers and footers. I don't want any data
inside HTML brackets. I tried:
s/*//g;
I don't understand why this doesn't work.
: Some of the files have HTML headers and footers. I don't want any data
: inside HTML brackets. I tried:
:
: s/*//g;
:
: I don't understand why this doesn't work.
Because (a) * in a regex means zero or more less-thans, and (b)
Perl regex matching is greedy- it matches the longest
Sorry so lengthy but here goes:
I am a Perl newbie and trying to parse a file. Depending on the tags in the
data I want to parse each line a different way. I built the following
program to test my process.
use strict;
my (@lines, $testln, @REFln);
while () {
chomp;
testType
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Tue, 24 Apr 2001 [EMAIL PROTECTED] wrote:
Thank you very much for all the great help I received earlier on extracting
numbers from text. There is only one thing I forgot about:
Some of the files have HTML headers and footers. I don't want
Hi Joel,
Did you type this in by hand? :)
parseRef ($testln);
sub parseREF {
You would want to change one of those! Anyways..
Your problem is in this line:
if ($REFln[1] = SN) {
= is for assignments. You want this to be:
if ($REFln[1] eq SN) {
To learn more
--- [EMAIL PROTECTED] wrote:
Thank you very much for all the great help I received earlier on
extracting numbers from text. There is only one thing I forgot
about:
Some of the files have HTML headers and footers. I don't want any
data inside HTML brackets. I tried:
s/*//g;
I don't
On Tue, Apr 24, 2001 at 04:33:00PM -0400, Timothy Kimball wrote:
You can avoid this by always writing comparisons with the constant
(if there is one) on the left-hand side:
if (SN eq $REFln)
but I rarely see people actually do that.
I think that's because it feels so unnatural and
: Try s/.*//g - the . means any character and will eliminate a
: less-than, then 0 or more characters, then a greater than.
Careful: if there's more than one greater-than in the line, this regex
will wipe out everything between (and including) the first and the
last on the line, because Perl
On Tue, 24 Apr 2001 [EMAIL PROTECTED] wrote:
Thank you very much for all the great help I received earlier on extracting
numbers from text. There is only one thing I forgot about:
Some of the files have HTML headers and footers. I don't want any data
inside HTML brackets. I tried:
--- Timothy Kimball [EMAIL PROTECTED] wrote:
Ah, yes, one of the most frustrating bugs in the world:
: if ($REFln[1] = SN) {
This *assigns* the value SN to $REFln[1]. What you want to do is
*test* it. String comparisons in Perl are done with eq (and numeric
comparisons with ==). So you
Hi Guys,
I'm writing a script that will read a file, the data
on the file are directories in a win2k server. I
would like to test if the folder exists and create the
folder if it doesn't exist. Please give me an example
of how I can accomplish this.
Regards,
Peter
=
Peter Lemus
Computer
I had a pm that used to be working and is called using use ABC::Test;. I
deleted (for some stupid reasons) the perl directory and didn't realize I
also deleted the ABC subdirectory below site\lib. I took another copy from
another machine and placed it back under site\lib but now I'm getting
There's already a lot of good advice here, but just one more thing...
Some people write HTML code like this
TAGNAME
FOO='all your base'
BAR='are belong to us'
Using:
s/.*?//g
Doesn't account for that and it won't match.
To allow '.' to match line breaks in tags, use:
--- Peter Lemus [EMAIL PROTECTED] wrote:
I'm writing a script that will read a file, the data
on the file are directories in a win2k server. I
would like to test if the folder exists and create the
folder if it doesn't exist. Please give me an example
of how I can accomplish this.
open
At 10:27 AM 4/24/2001, you wrote:
Another possible solution is to use Brian Ingerson's Inline.pm and code
the reads c. with C's lower level IO. I think a C getc() would do
it
But be warned that, while it's actually quite friendly, a raw beginner
might have some trouble with the Inline stuff,
Hi, are there ani perl5 binaries for OS/2 Warp?
=
Calin
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
On Tue, Apr 24, 2001 at 06:52:02AM -0500, Steve Neu wrote:
perl myscript.pl data1 data2 data3
(a) is it possible to pass data arguments via the command line in this
way?
[snip options]
-or-
my ($username, $password, $logfile, $filename) = @ARGV
# Expect 4 arguments
#
All,
When I use strict function, I get an error in the following code.
#!/usr/local/bin/perl
use strict ;
my @vob_list = `cleartool lsvob | grep *`;
my $entry ;
foreach $entry (@vob_list) {
chomp $entry;
my @fields = split /\s+/, $entry;
my $tag_list ;
my $vbs_list ;
@tag_list = @fields[1]
Woah! Perl has a getc() function?!! /me goes to look it up! :) Schwing!
-Original Message-
From: Sean O'Leary [mailto:[EMAIL PROTECTED]]
Sent: 24 April 2001 10:16
To: [EMAIL PROTECTED]
Subject: Re: sysread and buffering
...
But all that's moot, considering that Perl has getc(),
- Original Message -
From: Stout, Joel R [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 24, 2001 10:20 PM
Subject: [beginner] file parsing question
Sorry so lengthy but here goes:
I am a Perl newbie and trying to parse a file. Depending on the tags in
the
data I want
--- [EMAIL PROTECTED] wrote:
All,
When I use strict function, I get an error in the following
code.
#!/usr/local/bin/perl
use strict ;
my @vob_list = `cleartool lsvob | grep *`;
my $entry ;
foreach $entry (@vob_list) {
chomp $entry;
my @fields = split /\s+/, $entry;
Watch
The error message you include points to some loadable object that Perl
is looking for. Did Test.pm by chance reference a library? Is that
library present somewhere in one of the directories included in @INC?
Perl can find Test.pm. It cannot find something that Test.pm needs. If
Perl cannot
How do i send an html file as an attachment using sendmail?
Thanks
Hi,
The error message you're getting is one of the many changes to the
nature of perl under strict. It usually means that the variable in
question needs to be either explicitely named (via
$::Package::Variable) or lexically scoped (via my, our, or use vars).
you've made a couple errors here,
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, April 22, 2001 12:28 AM
Subject: How to send attacments
How do i send an html file as an attachment using sendmail?
Thanks
Take a look at the MIME::Lite module...
I pretty printed for my own sanity:
use strict ;
my @vob_list = `cleartool lsvob | grep *`;
my $entry ;
foreach $entry (@vob_list) {
chomp $entry;
my @fields = split /\s+/, $entry;
my $tag_list ;
my $vbs_list ;
@tag_list = @fields[1] ;
@vbs_list = @fields[2] ;
foreach my $lock
At 05:08 PM 4/24/2001, you wrote:
I had a pm that used to be working and is called using use ABC::Test;. I
deleted (for some stupid reasons) the perl directory and didn't realize I
also deleted the ABC subdirectory below site\lib. I took another copy from
another machine and placed it back
Please go to
http://www.perl.com/
There is a pulldown menu at the top right. Make sure binaries is
selected. Click the 'go' button to the right of this pulldown. You'll
get a list of binary distributions (OS/2 is in the list).
Dan
Calin Popa wrote:
Hi, are there ani perl5
unsubscribe
Rajakumar Theja ([EMAIL PROTECTED]) wrote:
Hi,
I'm new to perl, so please help.
My installation of DBD::Oracle for Oracle 8.1.6
failed.
After reaching a dead end and not getting any help
from
dbi-users, I decided to copy over a previous
installation of the perl directory tree which
Arante, Susan ([EMAIL PROTECTED]) wrote:
Can't locate loadable object for module ABC::Test in @INC (@INC contains:
c:/perl/lib c:/perl/site/lib .) at - line 1
Dan's suggestion sounds good. Look into a directory that describes your
machine type and processor below the site directory.
Here is a line from a job description that has me baffled: ·Perl
scripting (must know how to Perl well enough to script inside a case
shell)
Leaving aside the use of Perl as a verb for another discusssion, is
this just a typo (common in job advertisements), or is there a case
shell that I have
On Tue, Apr 24, 2001 at 01:38:45PM -0400, Timothy Kimball wrote:
I've only been on the list a couple of days, and I've already seen a
couple of questions about regexes matching numbers.
...and I don't remember anyone mentioning Damian Conway's mind-boggling
Regexp::Common module:
By
In case inquiring minds would like to know...
Actually, the reason why I am trying to do this in PERL in the first place
is because I couldn't figure out how to do it in C++ on a UNIX machine
(getchar is not supposed to buffer, but it does in some cases). I thought I
would try it in PERL on UNIX
Paul wrote:
Another possible solution is to use Brian Ingerson's Inline.pm and code
the reads c. with C's lower level IO. I think a C getc() would do
it
But be warned that, while it's actually quite friendly, a raw beginner
might have some trouble with the Inline stuff, especially if
--- Eric Hanigan [EMAIL PROTECTED] wrote:
Hello,
Real greenhorn here. I'm modifying a discussion board script which
writes to an html file. I'm trying to insert the following into the
file:
!--#include file=titlepic.shtml--
So, I put this in the script:
print!--#include
Within the headers of messages sent out by this mailing list are the
following lines:
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
List-Post: mailto:[EMAIL PROTECTED]
List-Help: mailto:[EMAIL PROTECTED]
List-Unsubscribe: mailto:[EMAIL PROTECTED]
List-Subscribe: mailto:[EMAIL PROTECTED]
*Apologies for the duplicate Janet, I forgot to CC: the list*
ActiveState has a package TermReadKey, this is the ActiveState *read
'windows'* version of Term::ReadKey.
To access the ActiveState packages you should have ActiveState Perl
installed on your windows machine. At the DOS prompt:
C:\
Hello,
I have a WebPage here in our intranet and i would like
to know if it's possible to look for specific Outlook
e-mails when the user 'refreshes' the Page.
When one user clicks on the Refresh Button, i have to
read e-mails from a specific folder in OutLook 2000
and
update a Table inside my
78 matches
Mail list logo