Harold Castro [HC], on Thursday, February 17, 2005 at 22:47 (-0800
(PST)) typed:
HC> for example:
HC> here is my string:
HC> $_ = "but";
HC> s/u/a/g;
HC> print $_;
what about this:
( my $string = "but" ) =~ s/u/a/g;
--
...m8s, cu l8r, Brano.
[Old Farts don't have to be politically correct.]
Harold Castro [HC], on Thursday, February 17, 2005 at 22:03 (-0800
(PST)) wrote:
HC> I'm parsing a log file that contains numbers
HC> enclosed by []. Ex. [1108702375]
$string = '[1108702375] text [232134324] text...';
while ( $string =~ /\[(\d+)\]/g ) { print $1 }
helps ?
--
...m8s, cu l8
=~ is the bind operator.
see perldoc perlop.
Manav
-Original Message-
From: Harold Castro [mailto:[EMAIL PROTECTED]
Sent: Friday, February 18, 2005 12:17 PM
To: beginners@perl.org
Subject: simple substitution question
Hi,
There is something that's bothering me for so long
regarding
I have a small question.
Using Perl, I'd like to send an email to an exchange distribution list. How can it
be done. Is there a module that acts like an outlook client to connect
to the exchange server. I've searched a lot on CPAN but couldn't find
anything. I want to use it from Linux and not W
On Fri, 18 Feb 2005, Hany Nagaty wrote:
> I have a small question.
>
> Using Perl, I'd like to send an email to an exchange distribution
> list. How can it be done. Is there a module that acts like an outlook
> client to connect to the exchange server. I've searched a lot on CPAN
> but couldn'
Hello,
I am looking for ways to move data
between array and hashes.
Does anybody has a better way or idea to do some of this:
Example 1:
@indatas = $datas [0 .. 4];
Example 2:
$nkey = $dataln[3] . $dataln[4];
Example 3:
$base{$bv[0]} = [ $bv[1], $bv[2], $bv[3], $bv[4] ];
On Fri, 2005-02-18 at 06:49 -0500, Chris Devers wrote:
> On Fri, 18 Feb 2005, Hany Nagaty wrote:
>
> > I have a small question.
> >
> > Using Perl, I'd like to send an email to an exchange distribution
> > list. How can it be done. Is there a module that acts like an outlook
> > client to conne
"Perl newbie" is way too much when referred to me. I've never even thought
to try to understand a single character of a perl program. Now I need to.
But, still, I don't want. I live more than well with my knowledge of other
languages.
However I'm facing a wonderful Courier ESMTP setup that require
Lucio Crusca wrote:
"Perl newbie" is way too much when referred to me. I've never even thought
to try to understand a single character of a perl program. Now I need to.
But, still, I don't want. I live more than well with my knowledge of other
languages.
However I'm facing a wonderful Courier ESMTP
On Fri, 18 Feb 2005, Lucio Crusca wrote:
> What I need is to call an external executable passing a filename as
> the only argument and then returning its output to the caller of the
> perl script, e.g:
>
> $reply=`myfilter.sh $filename`;
> print $reply;
>
> Is the above code correct for my pur
> Subject: Example of hash and array movement correct?
>
>
>
> Hello,
Hello
> I am looking for ways to move data
> between array and hashes.
>
In all 3 of your examples, you don't show us the declaration of your
variables nor how they are filled with data. I can make some
ass
Bastian Angerstein <[EMAIL PROTECTED]> wrote:
: Hello,
: I am looking for ways to move data
: between array and hashes.
:
: Does anybody has a better way or idea to do some of this:
Not really. What you have works, though the first example
will throw a warning under strictures and wa
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Lucio Crusca) writes:
>However I'm facing a wonderful Courier ESMTP setup that requires me to use
>perl in order to write a filter. And I don't want to use perl. So I could
>use one single perl operator I've found: backticks.
>
>What I need is to
On 17 Feb 2005, at 21:40, Doug Essinger-Hileman wrote:
On 17 Feb 2005 at 11:27, Ken Gillett wrote:
Initially the storage requirements are 2:1, so simply dividing the
name by 3 would (I think) work, i.e. if the name is exactly divisible
by 3 or not could determine in which location to place it. But
I'm moving from PHP to mod_perl. What a jump...
Normally in php it's as simple as:
session_start();
Then depending on your settings the session is kept in a cookie
or in the url.
I've looked into Apache::Session a bit, also Session (which is a
wrapper for Apache:Session.)
I set it up locally usin
Hello there!
As we know and as Larry Wall said in a Camel-book 0 in scalar variable
is equal to undef. I have in my database PID columns with unique values.
When I try to perform this column data by "while my $pid =
$sth->fetchrow_array()" I lost one record because it has the "0" value.
How cou
On Fri, 2005-02-18 at 12:43 -0600, Boysenberry Payne wrote:
> Normally in php it's as simple as:
> session_start();
It's that easy with mod_perl too if you use Apache::SessionManager.
Save yourself some trouble and just use that.
http://search.cpan.org/search?query=Apache-SessionManager&mode=dist
> Hello there!
>
> As we know and as Larry Wall said in a Camel-book 0 in scalar variable
> is equal to undef. I have in my database PID columns with unique values.
> When I try to perform this column data by "while my $pid =
> $sth->fetchrow_array()" I lost one record because it has the "0" va
Lawrence Statton wrote:
Hello there!
As we know and as Larry Wall said in a Camel-book 0 in scalar variable
is equal to undef. I have in my database PID columns with unique values.
When I try to perform this column data by "while my $pid =
$sth->fetchrow_array()" I lost one record because it has
Are there any not-so-obvious problems with untainting user input for passing
to the shell with something like (for the sake of simplicity):
# need to be able to use "." and "-" characters as well as
alphanumerics
chomp ( my $input = );
$input =~ s/[^A-Za-z0-9\-\.]//g;
Hi Perl-Crunchers,
I've got the following code:
#!/usr/bin/perl
use warnings;
use strict;
my $logdir = '/some/application/logs';
my @logs = <$logdir/*>;
push @ARGV, @logs;
while( <> ) {
print "$filename:\n$_" if( /with errors/ );
}
Of course, my problem is that I'm not filling in $f
Larsen, Errin M HMMA/IT wrote:
> Hi Perl-Crunchers,
>
> I've got the following code:
>
> #!/usr/bin/perl
>
> use warnings;
> use strict;
>
> my $logdir = '/some/application/logs';
> my @logs = <$logdir/*>;
>
> push @ARGV, @logs;
> while( <> ) {
> print "$filename:\n$_" if( /with errors
> Larsen, Errin M HMMA/IT wrote:
> > Hi Perl-Crunchers,
> >
> > I've got the following code:
> >
<>
> > push @ARGV, @logs;
> > while( <> ) {
> > print "$filename:\n$_" if( /with errors/ );
> > }
> >
> > Of course, my problem is that I'm not filling in $filename in that
> > print state
Larsen, Errin M HMMA/IT wrote:
>> Larsen, Errin M HMMA/IT wrote:
>>> Hi Perl-Crunchers,
>>>
>>> I've got the following code:
>>>
>
> <>
>
>>> push @ARGV, @logs;
>>> while( <> ) {
>>> print "$filename:\n$_" if( /with errors/ );
>>> }
>>>
>>> Of course, my problem is that I'm not filling
Larsen, Errin M HMMA/IT wrote:
Hi Perl-Crunchers,
Hello,
I've got the following code:
#!/usr/bin/perl
use warnings;
use strict;
my $logdir = '/some/application/logs';
my @logs = <$logdir/*>;
push @ARGV, @logs;
while( <> ) {
print "$filename:\n$_" if( /with errors/ );
}
Of course, my probl
Wagner, David --- Senior Programmer Analyst --- WGO wrote:
Larsen, Errin M HMMA/IT wrote:
Hi Perl-Crunchers,
I've got the following code:
#!/usr/bin/perl
use warnings;
use strict;
my $logdir = '/some/application/logs';
my @logs = <$logdir/*>;
push @ARGV, @logs;
while( <> ) {
print "$filena
John W. Krahn wrote:
> Wagner, David --- Senior Programmer Analyst --- WGO wrote:
>> Larsen, Errin M HMMA/IT wrote:
>>
>>> Hi Perl-Crunchers,
>>>
>>> I've got the following code:
>>>
>>> #!/usr/bin/perl
>>>
>>> use warnings;
>>> use strict;
>>>
>>> my $logdir = '/some/application/logs';
>>> m
Larsen, Errin M HMMA/IT wrote:
So, the <> operator shift()s the filenames off the top of @ARGV?
That's usefull knowledge.
Yes, but it does it before the loop starts!
$ perl -le'
print for @ARGV;
print;
while (<>) { print "$ARGV\t$ARGV[0]" if $. == 1; close ARGV if eof }
print;
print for @
John W. Krahn wrote:
Wagner, David --- Senior Programmer Analyst --- WGO wrote:
Larsen, Errin M HMMA/IT wrote:
Hi Perl-Crunchers,
I've got the following code:
#!/usr/bin/perl
use warnings;
use strict;
my $logdir = '/some/application/logs';
my @logs = <$logdir/*>;
push @ARGV, @logs;
while( <> ) {
> -Original Message-
> From: Jay [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 18, 2005 3:42 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Securing user data
>
> On Fri, 18 Feb 2005 14:33:24 -0600, Tyson Sommer
> <[EMAIL PROTECTED]> wrote:
> > Are there any not-so-obvious problems wi
On Friday 18 Feb 2005 23:16, Tyson Sommer wrote:
> Is there any way to squeeze the following into one line? (assume using
> CGI.pm and that my $q = new CGI;):
Don't hijack threads. Please start another.
--
Just getting into the best language ever...
Fancy a [EMAIL PROTECTED] or something
on htt
Tyson Sommer wrote:
Those are some good points. I should definitely strip any leading "-"s. This
appears to work:
$input =~ s/^-*|[^A-Za-z0-9.-_]//g;
That could be simplified to:
$input =~ s/^-*|[^a-z.-_]//g;
Because the range [.-_] includes uppercase letters and numbers unless you
real
Does anyone know if there are any Perl scripts out there that will do
the following:
I want a script that gets pointed to a directory and searches that
directory and all
sub-directories for *.html (or I can just pass all the files to it
with a simple find
command) . When it finds an *.html file i
AstroDrabb wrote:
Does anyone know if there are any Perl scripts out there that will do
the following:
I want a script that gets pointed to a directory and searches that
directory and all
sub-directories for *.html (or I can just pass all the files to it
with a simple find
command) . When it finds
On 18 Feb 2005 at 16:12, Ken Gillett wrote:
> That's very much what I had in mind, but I couldn't figure how to
> automatically set up which remainders go to which HD. I want just the
> ratio to be specified and everything else to be calculated. However, I
> think I can see how to do that now.
>
35 matches
Mail list logo