On 5 Mar 2003, jdavis wrote:
> hello,
> I am trying to test a key from a hash in a hash
> the script gives me the desired result overall but i get
> the warning ...
> Use of uninitalized value in pattern match (m//) at ./passwd.pl line 26.
> could someone tell me why i get this error
>
> here is
Hi,
I would like to upload and download files to a Linux server from my
Windows machine. So, I set out to write a little script that does just
that. Uploading, it turns out, is no problem. I use an "opendir"
statement to open the directory, then readdir to read its contents and
then each file
On Thu, 6 Mar 2003, ruben van de vijver wrote:
> Hi,
>
> I would like to upload and download files to a Linux server from my
> Windows machine. So, I set out to write a little script that does just
> that. Uploading, it turns out, is no problem. I use an "opendir"
> statement to open the direc
Janek Schleicher wrote:
> Rob Dixon wrote at Wed, 05 Mar 2003 18:28:36 +:
>
> > Rob wrote:
> > > Is there a perl command to list installed modules?
> >
> > This is a FAQ.
>
> Where can this FAQ be found ?
> I tried
> perldoc -q installed
> perldoc -q module
> perldoc -q list
> with Perl 5.8.0
Hi Jerry.
"Jerry Preston" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi!
>
> I am looking for way to reduce the following code, a better way, a
perl
> way. Any ideas?
I think you've been overlooked a little because your post looks
very much like a 'please do my work for me' p
hi group!
i'm currently trying to match all variables in a file, the regex i use looks
like this :
m/([\$|\@|\%]\w+)/g
it matches as far as i can see what i want but it also matches stuff like
this :
|SOMETEXT
why is this? what am i doing wrong?
thanks in advance
daniel.
--
To unsubscrib
Daniel,
Inside [ ] means "any of the following", so you don't use the | as an OR
in this situation. Take the | out and you should be fine. Here's my
example:
#!/usr/bin/perl -w
use strict;
my $variable1; my @variable2; my %variable3;
$variable1=1; @variable2=(1,2,3); %variable3=(1,2,3,4);
# |SOME
Rob Dixon wrote at Thu, 06 Mar 2003 11:06:06 +:
>> > > Is there a perl command to list installed modules?
>> >
>> > This is a FAQ.
>>
>> Where can this FAQ be found ?
>> I tried
>> perldoc -q installed
>> perldoc -q module
>> perldoc -q list
>> with Perl 5.8.0
>
> I was meaning 'This is a Fre
Daniel Mueller wrote:
>
> hi group!
>
> i'm currently trying to match all variables in a file, the regex i use looks
> like this :
>
> m/([\$|\@|\%]\w+)/g
You seem to have mixed two ways to do it
m/([EMAIL PROTECTED])/g; or
m/((?:\$|\@|%)\w+)/g;
/Stefan
--
To unsubscribe, e-mail: [EMAIL
Sorry :)
http://yapc.org/America/
Cheers,
Kevin
On Wed, Mar 05, 2003 at 05:49:52PM -0800, R. Joseph Newton ([EMAIL PROTECTED]) said
something similar to:
> Kevin Meltzer wrote:
>
> > Hello folks,
> >
> > ...
> > It will be June 16-18, 2003 in Boca Raton, FL. Please visit the website
> > to lea
Hi to all,
Im new to the list and to the Perl too...and I've some problems with pattern matching.
from a string of this kind:
that can have none or more parameter (as color) I would like to estract th 'kiwpg'
value.
How can I do?
=
another problem
If I have a string
On Thu, 2003-03-06 at 09:32, Francesco del Vecchio wrote:
> If I have a string as the following:
> a xx b a x b
> and I try a m/a(.*)b/g
> $1 = xx b a x
> what have I to do to obtain two matches each of one give me
> $1 = x
#!/usr/bin/perl -w
u
#!/usr/bin/perl -w
use strict;
my $string = q();
my $string2 = 'a xxbxxx b a xxaxx b';
print "$1\n" if $string =~ m!kiwpg=(.*?)'!; #'
my @array = $string2 =~ m/a(.*?)b/g;
print "@array\n";
__END__
. match one of anything
* match what is before it 0 or more
Here I am again ^_^
thanks a lot for the previous answers...they solved my problem.
I have another problem of the same kind...let me explain:
=
String " bb=somestuff someotherstuff"
I don't know what "somestuff" and "someotherstuff" are...I only kn
Francesco Del Vecchio wrote:
>
> String " bb=somestuff someotherstuff"
>
> I don't know what "somestuff" and "someotherstuff" are...I only know
> that they are two words separed by a space.
>
> How can I extract 'somestuff' from the string?
Hi Francesco .
It depends how you want to define wh
Maybe I can explain better showing you the real problem.
I have an HTML form and I'm parsing it looking for tags
When I find one I need to catch the "ACTION" value.
i.e.
http://www.somedomain.com method=post>
I need to catch "http://www.somedomain.com";. Obiouvsly the "method" can also not t
Francesco Del Vecchio wrote:
> Maybe I can explain better showing you the real problem.
>
> I have an HTML form and I'm parsing it looking for tags
>
> When I find one I need to catch the "ACTION" value.
>
> i.e.
>
> http://www.somedomain.com method=post>
>
> I need to catch "http://www.somedomain
Look at the sprintf function. Please!
> # while ( $data ) = $sth->fetchrow()) {
> $l = length( $Site );
> if( $l != 5 ) {
> $s = substr( "", 0, 5 - $l );
> $Site .= $s;
> }
Does this do what you want?
$Site = sprintf '%-5s', $Site;
One liner:
C:\>perl -e"$S
jdavis wrote:
if($hoh{$who}{$what} =~ /\w/){
> print "$hoh{$who}{$what}\n";
hoh? Huh?!? Where'dthatcomefrom?
use strict;
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Trying to get this to work on one line, but not having any success. In my
boredom I re-wrote the find command using perl4, and in tweaking it I'm
running into a problem. When I type in a starting search path as
"./something/something" I want to replace the "." with the current working
directory. S
Jerry Preston wrote:
>
> Hi!
Hello,
> I am looking for way to reduce the following code, a better way, a perl
> way. Any ideas?
>
> while ( my ( $Site, $Description, $Part_Number, $Part_Serial_Number, $Qty,
> $RMA_Number, $Customer_Contac, $RMA_Date, $Part_Rec ) = $sth->fetchrow()) {
> # w
Daniel Mueller wrote:
>
> hi group!
Hello,
> i'm currently trying to match all variables in a file, the regex i use looks
> like this :
>
> m/([\$|\@|\%]\w+)/g
>
> it matches as far as i can see what i want but it also matches stuff like
> this :
>
> |SOMETEXT
>
> why is this? what am i doin
Jensen Kenneth B Sra Afpc/Dpdmpq wrote:
>
> Trying to get this to work on one line, but not having any success. In my
> boredom I re-wrote the find command using perl4, and in tweaking it I'm
> running into a problem. When I type in a starting search path as
> "./something/something" I want to re
John W. Krahn wrote:
>> ($_pattern, $_start) = (shift, shift);
>> print "Starting search at: $_start\n";
>>
>> chdir "$_start";
>
> Useless use of quotes. You should verify that chdir worked.
>
> unless ( chdir $_start ) {
> print STDERR "Cannot chdir to $_start: $!";
> exit 1;
> }
Hi Experts!
Hoping someone can help me out. Here goes...
bear with me, please.
I have a file that contains a few email
addresses. I read this file and push each line
into an array:
push(@AddrArray, $_);
Then I do a foreach on the contents of the
array:
foreach $AddrToCheck (@AddrArray) {
.
Hello,
I'm trying to write a script that reads a file line by line and if the line
contains a space it puts quotation marks around it and writes it to another
file. I mostly have this working except that in the case of the lines that
contain the space it puts the quotation mark at the beginning of
Greetings, all!
I have a mail server with swatch examining the log files looking for
root.exe, /winnt/system32, etc. The idea is finding anyone who is
scanning for root kits on my mail server gets blocked at the mail server
and the firewall with an iptables command.
What I have is swatch executi
In other languages, such as C, there is little difference between a while()
loop and a do-while() loop. The only difference of course being that that
do-while() loop will always execute at least once (test after), while the
while-loop does a test before
Much to my amazement, do() in perl is
> Hello,
> I'm trying to write a script that reads a file line by line
> and if the line
> contains a space it puts quotation marks around it and writes
> it to another
> file. I mostly have this working except that in the case of
> the lines that
> contain the space it puts the quotation mark
[most of message cut for clarity, see original for context]
> Now, I have an internally developed function
> (the internal of which are hidden from me) which
> processes the email addresses. This takes as one
> of it's parameters an array of strings.
> So before I call the function I say:
> @AddrL
Can anyone direct me to HTML help?
Re: Tables, backround, and images
Thanks
Lou
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
The EOLN character is not being stripped out, so you're getting it before
your quote. chomp it to remove it. Here's my version:
#!/usr/bin/perl -w
use strict;
open INFILE, "accounts.txt" or die "Can't open INFILE: $!";
open OUTFILE, ">nospace.txt" or die "Can't open OUTFILE: $!";
while () {
test
From: "Scott R. Godin" <[EMAIL PROTECTED]>
> John W. Krahn wrote:
> > unless ( opendir( DIR, $_start ) ) {
> > print STDERR "Cannot open $_start: $!";
> > exit 1;
> > }
>
> die "Cannot open directory $_start: $!"
> unless opendir(DIR, $_start);
Just FYI these two are not equiv
It sounds like you need two things:
1. A faster way of storing "seen" IPs.
2. A lock mechanism to keep perl processes queued up waiting to write
new iptables entries.
Having the perl script write a lock file as it is updating the iptables
should be easy - subsequent scripts can wait to ensure tha
You probably should have started a new thread for this discussion.
> I'm trying to write a script that reads a file line by line and if the
line
> contains a space it puts quotation marks around it and writes it to
another
> file. I mostly have this working except that in the case of the lines
th
> Much to my amazement, do() in perl is
> a STATEMENT BLOCK and not a loop!
But that doesn't mean that you can't use it like one.
In Perl you can use for/while/if/unless after a statement...
print "Blue" if $x == 1;
print ++$x while $x < 10;
The "do" lets you turn the for into a do-for, if into
Mark Anderson wrote:
[most of message cut for clarity, see original for context]
Now, I have an internally developed function
(the internal of which are hidden from me) which
processes the email addresses. This takes as one
of it's parameters an array of strings.
So before I call the function I
> > I'm trying to write a script that reads a file line by line and if the
line
> > contains a space it puts quotation marks around it and writes it to
another
> > file. I mostly have this working except that in the case of the lines
that
> > contain the space it puts the quotation mark at the
>Jensen Kenneth B Sra Afpc/Dpdmpq wrote:
>>
>> Trying to get this to work on one line, but not having any success. In
>> my boredom I re-wrote the find command using perl4, and in tweaking it
>> I'm running into a problem. When I type in a starting search path as
>> "./something/something"
From: Jeff Westman <[EMAIL PROTECTED]>
> In other languages, such as C, there is little difference between a
> while() loop and a do-while() loop. The only difference of course
> being that that do-while() loop will always execute at least once
> (test after), while the while-loop does a test bef
Can some tell me what is a good whois mod for perl that works with
activestate?
Thomas Browner
Digidyne, Inc
Technical Engineer
(251)479-1637
> > > line. My guess is that
> > > print OUTFILE ($line);
> > > also feeds a CR. Is there a way around this?
>
> > while () {
> > chomp;
> > if (/ /) {
> > print OUTFILE "\"$line\"\n";
> > }
> > else {
> > print OUTFILE $line, "\n";
> > }
> > }
> >
>
See mark's reply also but there is a chance it is something else
meriwether lewis wrote:
Hi Experts!
This takes as one
of it's parameters an array of strings.
An array of strings, or an array reference? big difference.
I then pass @AddrList to the function like so:
processAddrList($foo, "N
> -Original Message-
> From: mel awaisi [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 05, 2003 2:11 PM
> To: [EMAIL PROTECTED]
> Subject: Script does not want to run, error
>
>
> Hi,
>
> I am having problems opening this script on my machine. i
> have been getting
> help from a ve
Michael Weber wrote:
Greetings, all!
I have a mail server with swatch examining the log files looking for
root.exe, /winnt/system32, etc. The idea is finding anyone who is
scanning for root kits on my mail server gets blocked at the mail server
and the firewall with an iptables command.
What I
Francesco del Vecchio wrote:
> Maybe I can explain better showing you the real problem.
>
> I have an HTML form and I'm parsing it looking for tags
>
> When I find one I need to catch the "ACTION" value.
>
> i.e.
>
> http://www.somedomain.com method=post>
>
> I need to catch "http://www.somedomai
Luinrandir Hernsen wrote:
Can anyone direct me to HTML help?
Re: Tables, backround, and images
Thanks
Lou
You mean besides the obvious:
http://www.google.com/search?&q=HTML
Remember this is a Perl list. There must be as many books on HTML as
there are web pages at this point, check any bookst
Jensen Kenneth B SrA AFPC/DPDMPQ wrote:
The use of quotes may be useless, but it's just more
aesthetically appealing to me. I doubt they really effect processing speed
by any measurable amount anyway :).
As just posted, the quotes affect more than speed...
perldoc -q "wrong with always quotin
Jenda,
You CANNOT do what you are suggesting.
$ perldoc -f do
do BLOCK
Not really a function. Returns the value of the last command
in the sequence of commands indicated by BLOCK. When modified
by a loop modifier, executes the BLOCK once before
--- "Hanson, Rob" <[EMAIL PROTECTED]> wrote:
> > Much to my amazement, do() in perl is
> > a STATEMENT BLOCK and not a loop!
>
> But that doesn't mean that you can't use it like one.
>
> In Perl you can use for/while/if/unless after a statement...
>
> print "Blue" if $x == 1;
> print ++$x while
According to the perl documentation because 'do' is a STATEMENT, you
cannot use LOOP CONSTRUCTS (next, last). Sure, you can loop (as shown
below), but you cannot exit the loop with "last". (I should have been more
clear in my original post)
Consider the following:
$ nl -ba x
1 #!/usr
> -Original Message-
> From: Bakken, Luke [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 06, 2003 4:47 PM
> To: Michael Weber; [EMAIL PROTECTED]
> Subject: RE: Handling race conditions
>
>
> It sounds like you need two things:
>
> 1. A faster way of storing "seen" IPs.
> 2. A lock mec
Greg Carrara wrote:
>
> unless (open(INFILE, "accounts.txt")) {
>
> die ("Cannot open input file accounts.txt.\n");
> }
>
> unless (open(OUTFILE, ">nospace.txt")) {
>
> die ("Cannot open output file nospace.txt.\n");
> }
>
> $line = ;
>
> while ($line ne "") {
>
> if ($line
Mark Lobue wrote:
>
> Check out "Network Programming with Perl". It can show you how to set up
> an easy client-server system, where your mail server can call the client,
> and
> the client contacts the server through a socket. Even if many clients
> fire at once, the socket connection forces s
Wiggins d'Anconia wrote:
>
> In general this would be handled with a lock file. When the first
> instance of your script starts it would check for the lock file if it
> exists then just exit, if it doesn't then it opens a file (.lock for
> example) then does its processing, and then removes the lo
I have been using:
use Mail::POP3Client;
$pop = new Mail::POP3Client( USER => "TheUser",
PASSWORD => "MyPassword",
HOST => "Mail.Host.com");
successfully for some time to read and parse email off a remote server.
I was aske
"Scott R. Godin" wrote:
>
> John W. Krahn wrote:
>
> >> ($_pattern, $_start) = (shift, shift);
> >> print "Starting search at: $_start\n";
> >>
> >> chdir "$_start";
> >
> > Useless use of quotes. You should verify that chdir worked.
> >
> > unless ( chdir $_start ) {
> > print STDERR "Canno
Jensen Kenneth B Sra Afpc/Dpdmpq wrote:
> >
> >$_spath =~ s{^\.}
> >{ $path = `pwd`;
> > chop $path;
> > $path
> >}e;
>
> I wasn't aware I could have multiple commands in there. Had to change it
> around so perl4 would be happy, no white space and
You can loop, but can NOT use loop constructs, such as next or last.
--- "Hanson, Rob" <[EMAIL PROTECTED]> wrote:
> > Much to my amazement, do() in perl is
> > a STATEMENT BLOCK and not a loop!
>
> But that doesn't mean that you can't use it like one.
>
> In Perl you can use for/while/if/unless
Greg Carrara wrote:
>
> Hello,
Hello,
> I'm trying to write a script that reads a file line by line and if the line
> contains a space it puts quotation marks around it and writes it to another
> file. I mostly have this working except that in the case of the lines that
> contain the space it p
Gidday All,
please help with my subroutine
sub cleanText{
my $cleanedText = @_;
$cleanedText =~ s{}{}g;
$cleanedText =~ s{}{}g;
$cleanedText =~ s{<\/b>}{<\/span>}g;
$cleanedText =~ s{Fittingly, the first student to arrive on the first day at
Booligal Public's new era was Steven Spiers.
On Fri, 7 Mar 2003, Johnstone, Colin wrote:
> Gidday All,
>
> please help with my subroutine
>
> sub cleanText{
> my $cleanedText = @_;
This is the problem, assigning an array to a scalar stores the number of
elements in the array (in this case the number of args to cleanText) in
the scalar
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 07, 2003 4:11 PM
> To: [EMAIL PROTECTED]
> Subject: PErl subroutine
>
>
> Gidday All,
>
> please help with my subroutine
>
> sub cleanText{
> my $cleanedText = @_;
>
my $cleanedText = s
"Johnstone, Colin" wrote:
> Gidday All,
>
> please help with my subroutine
>
Your call to this sub below offers a single string parameter--which happens to be
multiline.
>
> sub cleanText{
> my $cleanedText = @_;
#Since there is one element in @_, $cleanedText now has the value 1 or '1'
> $
Sudarshan Raghavan wrote at Fri, 07 Mar 2003 10:53:31 +0530:
>> sub cleanText{
>> my $cleanedText = @_;
>
> This is the problem, assigning an array to a scalar stores the number of
> elements in the array (in this case the number of args to cleanText) in
> the scalar ($cleanedText). Change this
On Fri, 2003-03-07 at 13:51, R. Joseph Newton wrote:
> Wiggins d'Anconia wrote:
>
> >
> > In general this would be handled with a lock file. When the first
> > instance of your script starts it would check for the lock file if it
> > exists then just exit, if it doesn't then it opens a file (.lock
67 matches
Mail list logo