I.B. wrote:
> sorry, I didn't fraze my question correctly.
^
phrase
> example :
> $line="abcxabcxxabcxxxabc";
>
> how to match everything beofre "xxx" but not xxx itself?
> the answer i got is to use lookaheads:
>
> my $line = "abcxxabcxxxabc";
> if ($line =
Paul Johnson wrote:
> On Fri, Oct 13, 2006 at 01:04:01AM +1300, Robin Sheat wrote:
>
>>Hmm, when i started looking on the net, that was one of the first things that
>>came up. Also this:
>>http://www-128.ibm.com/developerworks/library/l-optperl.html
>>They're helpful, but unfortunately not large
sorry, I didn't fraze my question correctly.
example :
$line="abcxabcxxabcxxxabc";
how to match everything beofre "xxx" but not xxx itself?
the answer i got is to use lookaheads:
my $line = "abcxxabcxxxabc";
if ($line =~ m{(.*?(?:(?!xxx).))xxx}){
print "matched: $1\n";
}
else{
print "f
Robin Sheat wrote:
> On Thursday 12 October 2006 23:52, John W. Krahn wrote:
>>
>>my $users = get_all_users();
>>for ( my $i = 0; $i < @$users; ++$i ) {
>>my $details = get_user_details( $users->[ $i ] );
>>my $sum = 0;
>>my $count
I have implemented Nagios, and wanted to run this perl script to
interrogate my Oracle systems. This really isn't a coding question, but
rather a setup or execution question. I would like to understand why I
am getting the following error when I run check_oracle_instance.pl
natively from the linu
got it! very nice, not complicated at all. I didn't know about lookahead
feature. very useful.
this file that should be matched:
row 1
row 2
row 3
Bug some word
row 4
row 5
this is file that should not be matched:
row 1
row 2
row 3
Bug some word
row 4
row 5
row 6
this is soluti
On Fri, Oct 13, 2006 at 12:36:33PM -0500, Charles K. Clarkson wrote:
> I.B. wrote:
>
> : unfortunately I have to use regex to solve this problem.
>
> Why do you have to use a regex?
Because that is what the question stipulates.
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
I.B. wrote:
> Hi nice people,
Hello,
> how to specify using regular expressions: match everything but string (xxx)
>
> i would do this :
>
> $line =~ /[^(xxx)]+/;
>
> but, as it was mentioned before () inside character class is not working.
> what is solution here?
Perhaps you want:
$line !~
use !~ vs =~ which is if not so
if ( $line !~ /\(xxx\)/ ) {
# does not contain (xxx)
}else {
# does contain
}
If you have any problems or questions, please let me know.
Thanks.
Wags ;)
David R Wagner
Senior Program
On 10/13/2006 12:14 PM, I.B. wrote:
this is the problem:
use regular expressions to prove that word "Bug"
is in the 3 row from the end of table in the html tagged file:
shell> cat file1.txt
[...]
Don't use regular expressions to parse HTML. Use an HTML parsing module
to parse HTML.
Now to
On 10/13/2006 11:50 AM, Andrew Kennard wrote:
Hello all
We have recently moved to a new hosting company that also provides us with
an SSL service.
The scenario:
I have a form located at url http://www.mydomain.co.uk/myfolder/page1.htm
which on submission, uses a sub routine that opens the f
Hi nice people,
how to specify using regular expressions: match everything but string (xxx)
i would do this :
$line =~ /[^(xxx)]+/;
but, as it was mentioned before () inside character class is not working.
what is solution here?
thank you!
~i
I.B. wrote:
: unfortunately I have to use regex to solve this problem.
Why do you have to use a regex?
Charles K. Clarkson
--
Mobile Homes Specialist
Free Market Advocate
Web Programmer
254 968-8328
Don't tread on my bandwidth. Trim your posts.
--
To unsubscribe, e-mail: [EMAIL PROTE
On 10/13/2006 07:57 AM, Luba Pardo wrote:
Dear sir/madam:
I am trying to write a script to process to consecutive lines at a time and
compare elements of between two consecutive lines.
I don't understand this sentence.
I tried something like:
$i=0;
while (){
chomp;
@a1_s= split/\/, $a1_s[1];
this is the problem:
use regular expressions to prove that word "Bug"
is in the 3 row from the end of table in the html tagged file:
shell> cat file1.txt
row 1
row 2
row 3
Bug some word
row 4
row 5
shell>
shell> cat file2.txt
row 1
row 2
row 3
Bug some word
row 4
row 5
row 6
Hello all
We have recently moved to a new hosting company that also provides us with
an SSL service.
The scenario:
I have a form located at url http://www.mydomain.co.uk/myfolder/page1.htm
which on submission, uses a sub routine that opens the file that is being
passed to it (a .htm file - th
thank you for reponse!
unfortunately I have to use regex to solve this problem.
I was trying to simplify:
$file=~/.+Bug.+<\/tr>\s*.+<\/tr>\s*.+?<\/tr>\s*.+?<\/tr>\s*<\/table>/;
still does not work!!!
On 10/12/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
I . B . schreef:
> i have a task to ve
-Original Message-
From: Luba Pardo [mailto:[EMAIL PROTECTED]
Sent: Friday, October 13, 2006 6:27 PM
To: beginners@perl.org
Subject: consecutive lines in a file
Dear sir/madam:
I am trying to write a script to process to consecutive lines at a time and
compare elements of between two c
On 10/13/06, Luba Pardo <[EMAIL PROTECTED]> wrote:
I am trying to write a script to process to consecutive lines at a time and
compare elements of between two consecutive lines.
It might be easiest to read the file into an array. Of course, that's
only practical if it's not a large file.
@a1
Hi,
I tried uploading the source and binaries of my module to CPAN yesterday. I
first uploaded the source and then the binaries and now, probably due to the
timestamp, the download link on CPAN search points to the binaries rather
than the source.
What I really wanted to do was to have the downl
@ Rocteur CC wrote:
Hi,
I was just reading The State of the Onion 10
http://www.perl.com/pub/a/2006/09/21/onion.html by Larry, and if you
have not read it I think you will enjoy it. I really ROFL when I saw
that Randal was our own Evil Brother Damian ;-)
Anyway, Larry refers to Perl as SHE.
Robin Sheat wrote:
yeah, I understand Perl references, but you can't (afaik) do C-style pointer
arithmetic with them.
Luckily!
Without pointer arithmetic, this access:
$details->[ $j ]
is something akin to (in C/Perl/psuedocode mishmash):
address_of($details) + sizeof(void *) * $j
That mult
Perl is cross-platform, extremely useful for working with large
amounts of text, using regular expressions, it has a great repository
of modules for you to use for just about any task you can think of
(CPAN), it's open source, it's got a great community, the list goes
on and on.
I would r
Dear sir/madam:
I am trying to write a script to process to consecutive lines at a time and
compare elements of between two consecutive lines.
I tried something like:
$i=0;
while (){
chomp;
@a1_s= split/\/, $a1_s[1];
@temp1 = split/>/, $a2_s[1];
print " line is $i, array is @a1_s, array
On Friday 13 October 2006 14:37, Tim Wolak wrote:
> On Fri, 2006-10-13 at 14:35 +0200, Thomas Bätzler wrote:
> > Tim Wolak <[EMAIL PROTECTED]> asked:
> > > I'm working on rotating log files and am using the
> > > logfile::rotate module. What I need to do is add the date to
> > > the file name tha
I want them rotated but marked with dates in their file names, instead
of file.1, file.2 etc.
Tim
On Fri, 2006-10-13 at 14:35 +0200, Thomas Bätzler wrote:
> Tim Wolak <[EMAIL PROTECTED]> asked:
> > I'm working on rotating log files and am using the
> > logfile::rotate module. What I need to do
Tim Wolak <[EMAIL PROTECTED]> asked:
> I'm working on rotating log files and am using the
> logfile::rotate module. What I need to do is add the date to
> the file name that is being created.
What exactly are you trying to achieve? If you add
dates to the filenames, you're not rotating them
a
Jack Daniels (Butch) <[EMAIL PROTECTED]> wrote:
> Have spent the last couple hours searching Internet, reading
> my perl books, but I just can't figure it out.
>
> Problem:
> Our barcodes are 14 digits, however not all employees have a
> scanner when associating the barcode with an item.
> Barco
So what your are looking for is something to read the file:
open (IN, " ) {
# Clean it up a little bit
chomp;
# lets just keep the digits
$_ =~ s/\D*//g; # Replace anything that is not a digit with nothing
# Print anything that is not 14 characters in length
if ( length($_) <> 14 ) { print $_ . "
Hi all,
I'm working on rotating log files and am using the logfile::rotate
module. What I need to do is add the date to the file name that is
being created. Would I use the post function and move the file and
append it to the file? If so could you proved an example?
Thanks,
Tim
#!/usr/bin/pe
Have spent the last couple hours searching Internet, reading my perl books,
but I just can't figure it out.
Problem:
Our barcodes are 14 digits, however not all employees have a scanner when
associating the barcode with an item.
Barcodes are then manually entered and are not always entered correct
Hi All ,
I installed perl 5.8.8 . and now trying to use Thread but
it's Giving me error like Undefiend subroutine &thread::new called at
C:/Perl/lib/Thread.pm line 291
I am using the follwing code
use Thread qw(yield async);
async {
my $foo = 50;
32 matches
Mail list logo