On Thu, May 21, 2015 at 3:41 AM, Vincent Lequertier wrote:
> From http://perldoc.perl.org/perlmod.html#Perl-Modules, "1;" is used to end
> with a true value
There is a bit better explanation here:
http://www.perlmonks.org/?node_id=781340
In short, `use' is like syntactic sugar around `require'
From http://perldoc.perl.org/perlmod.html#Perl-Modules, "1;" is used to
end with a true value
---
Vincent Lequertier
s...@riseup.net
Le 2015-05-21 08:13, Sunita Pradhan a écrit :
Hi
Why a perl programmer use 1 or any number as last statement in module
or package (like : 1;)?I checked without t
When a module is loaded (via use) the compiler will complain unless the
last statement executed when it is loaded is true. This line ensures that
this is the case (as long as you don't place any code after this line).
Perl's way of making sure that it successfully parsed all the way to the
end of t
As Per my Understanding...
The last line file must contain the line with the 1; statement. As This in
effect returns a true value to the program using the module. if you are Not
using the 1; statement it will not let the module be loaded correctly.
On Thu, May 21, 2015 at 11:43 AM, Sunita Pradhan
On Fri, Jun 28, 2013 at 1:21 AM, Dr.Ruud wrote:
> On 28/06/2013 09:08, Charles DeRykus wrote:
>
> [...] I was making a case that "do" in limited cases could be a
>>
>> shorter and/or slightly clearer idiom.
>>
>
> I think the context was if you would ever go as far as using double braces
> to
On Fri, 28 Jun 2013 10:21:43 +0200
"Dr.Ruud" wrote:
> In a serious environment, code should be readable much more than
> writable. So spend the extra minutes to make it as clear and
> non-ambiguous as you can. Then someone else can more easily fix any
> bugs you introduced, without having to as
On 28/06/2013 09:08, Charles DeRykus wrote:
[...] I was making a case that "do" in limited cases could be a
shorter and/or slightly clearer idiom.
I think the context was if you would ever go as far as using double
braces to make a loop-construct out of 'do'. But even more how combining
a
On Thu, Jun 27, 2013 at 10:20 PM, shawn wilson wrote:
> >...
> > True. But, "do" should probably draw a more explicit caution in the docs
> > since there are less tricky ways in most cases.
> >
> > However, there may be a few places when 'do' isn't always a don't :)
> >
> > 'do' might be a short
On Fri, Jun 28, 2013 at 12:04 AM, Charles DeRykus wrote:
>
>
>
> On Thu, Jun 27, 2013 at 1:31 PM, Dr.Ruud wrote:
>>
>> On 27/06/2013 22:01, Shawn H Corey wrote:
>>>
>>> On Thu, 27 Jun 2013 21:53:46 +0200
>>> "Dr.Ruud" wrote:
See also 'Statement Modifiers' in perlsyn.
There it is s
On Thu, Jun 27, 2013 at 1:31 PM, Dr.Ruud wrote:
> On 27/06/2013 22:01, Shawn H Corey wrote:
>
>> On Thu, 27 Jun 2013 21:53:46 +0200
>> "Dr.Ruud" wrote:
>>
> See also 'Statement Modifiers' in perlsyn.
>>> There it is shown how to make next and last work with do{}. I read
>>> that as a rather fun
On 27/06/2013 22:01, Shawn H Corey wrote:
On Thu, 27 Jun 2013 21:53:46 +0200
"Dr.Ruud" wrote:
See also 'Statement Modifiers' in perlsyn.
There it is shown how to make next and last work with do{}. I read
that as a rather funny way to discourage people from do-ing it.
"Here be dragons." I w
On Thu, 27 Jun 2013 21:53:46 +0200
"Dr.Ruud" wrote:
> See also 'Statement Modifiers' in perlsyn.
>
> There it is shown how to make next and last work with do{}. I read
> that as a rather funny way to discourage people from do-ing it.
"Here be dragons." I would say that was a warning to avoid it
On 27/06/2013 17:03, Shawn H Corey wrote:
On Thu, 27 Jun 2013 07:45:17 -0700
Jim Gibson wrote:
Note that the statement modifier syntax allows you to write a
do-while or do-until loop, where at least one pass is made through
the loop before the loop termination test is performed:
do {
…
}
On Thu, Jun 27, 2013 at 4:33 AM, lee wrote:
> >> > This is sort of a p5p question but the above might cut this off at the
> >> > knees (or better show a gap that needs to be filled).
> >>
> >> What is a p5p question?
>
In case this was the original quesiont p5p stands for Perl 5 Porters, the
lis
On 27/06/2013 16:03, Shawn H Corey wrote:
On Thu, 27 Jun 2013 07:45:17 -0700
Jim Gibson wrote:
Note that the statement modifier syntax allows you to write a
do-while or do-until loop, where at least one pass is made through
the loop before the loop termination test is performed:
do {
…
} w
On 06/27/2013 05:39 AM, lee wrote:
John SJ Anderson writes:
Lee, have you read the 'statement modifiers' and 'compound statement'
portions of 'perldoc perlsyn'? You may find that this clarifies this
issue for you.
Well yes, I understand that there are two different kinds of 'if' one of
which
On Thu, 27 Jun 2013 07:45:17 -0700
Jim Gibson wrote:
> Note that the statement modifier syntax allows you to write a
> do-while or do-until loop, where at least one pass is made through
> the loop before the loop termination test is performed:
>
> do {
> …
> } while condition();
>
> The while
On Jun 27, 2013, at 2:39 AM, lee wrote:
> John SJ Anderson writes:
>
>> Lee, have you read the 'statement modifiers' and 'compound statement'
>> portions of 'perldoc perlsyn'? You may find that this clarifies this
>> issue for you.
>
> Well yes, I understand that there are two different kinds
shawn wilson writes:
> On Jun 25, 2013 3:11 AM, "lee" wrote:
>>
>> shawn wilson writes:
>>
>> > Lee, can you provide an example of another programming language that
>> > implements this or a thesis that describes this problem in more depth?
>>
>> I'm not sure what you mean --- other programming
John SJ Anderson writes:
> Lee, have you read the 'statement modifiers' and 'compound statement'
> portions of 'perldoc perlsyn'? You may find that this clarifies this
> issue for you.
Well yes, I understand that there are two different kinds of 'if' one of
which is kinda broken (but nonetheless
On Tue, Jun 25, 2013 at 9:23 AM, shawn wilson wrote:
>
> On Jun 25, 2013 3:11 AM, "lee" wrote:
>> I'm not sure what you mean --- other programming languages I know don't
>> have two different kinds of 'if's and the irregularities involved with
>> that.
> How does perl have "different kinds of i
On Jun 25, 2013 3:11 AM, "lee" wrote:
>
> shawn wilson writes:
>
> > Lee, can you provide an example of another programming language that
> > implements this or a thesis that describes this problem in more depth?
>
> I'm not sure what you mean --- other programming languages I know don't
> have t
On Mon, Jun 24, 2013 at 08:20:57PM -0700, John W. Krahn wrote:
> The parentheses in this case do nothing, and they certainly don't
> imply that last is a function.
>
> $ perl -le'
> use warnings;
> use strict;
> for (1..2) {
> ();
> }
In this case I'd guess that the parenthesis would be i
Uri Guttman writes:
> On 06/24/2013 08:46 AM, lee wrote:
>> John Delacour writes:
>>>
>>> “Stop if it’s raining, open your umbrella.”
>>>
>>> Nobody would know what you intend to say. No condition is actually
>>> attached to “stop”.
>> last if $its_raining;
>>
>> By your logic, no condition is
shawn wilson writes:
> Lee, can you provide an example of another programming language that
> implements this or a thesis that describes this problem in more depth?
I'm not sure what you mean --- other programming languages I know don't
have two different kinds of 'if's and the irregularities in
Brandon McCaig wrote:
On Sun, Jun 23, 2013 at 12:02:38PM +0300, Shlomi Fish wrote:
"last" is not a function (a.k.a "subroutine") - it cannot be.
It is a special statement which is handled in a special way by
the Perl interpreter. "redo" and "next" are not functions
either for a similar reason.
On Mon, 24 Jun 2013 17:14:02 -0400
Brandon McCaig wrote:
> I think that you are just misunderstanding what is happening
> here. `perldoc perlsyn' explains it. These are actually two
> different things. The compound if-statement, which is typical of
> other languages, and the if-style "statement m
On Mon, Jun 24, 2013 at 10:20:36AM +0200, lee wrote:
> It's logical and expected because an 'if' statement goes like
> 'if(condition) { is_true; } else { is_not_true;}'.
>
> Put a 'last' in front of the 'if' and the 'if' suddenly goes
> like 'if(condition_is_true) last;' and no more.
>
> Flipping
On 06/24/2013 08:46 AM, lee wrote:
John Delacour writes:
What you are saying is rather like expecting meaning from a sentence
It tells you to stop when it's raining and to open your umbrella.
like:
“Stop if it’s raining, open your umbrella.”
Nobody would know what you intend to say. No c
On Sun, Jun 23, 2013 at 12:02:38PM +0300, Shlomi Fish wrote:
> "last" is not a function (a.k.a "subroutine") - it cannot be.
> It is a special statement which is handled in a special way by
> the Perl interpreter. "redo" and "next" are not functions
> either for a similar reason.
I think we can al
Lee, can you provide an example of another programming language that
implements this or a thesis that describes this problem in more depth?
This is sort of a p5p question but the above might cut this off at the
knees (or better show a gap that needs to be filled).
Dr.Ruud wrote:
On 24/06/2013 07:36, lee wrote:
It would be like:
if ( $color eq "blue" ) {
print "test\n";
last;
}
Alternative:
print( "test\n" ), last
if $color eq "blue";
I also see:
print( "test\n" ) and last
if $color eq "blue";
but always question that, because: what if print() fai
Shlomi Fish writes:
>> An 'if' is an 'if', and when putting 'last' in front of it changes it to
>> something else, why isn't there a keyword for it like 'lastif'?
>>
>
> How so?
>
> last MYLABEL if $x == 5;
>
> does exactly the same as:
>
> if ($x == 5) {
> last MYLABEL;
> }
>
> Similarly:
"Dr.Ruud" writes:
> On 24/06/2013 07:36, lee wrote:
>
>> It would be like:
>>
>> if ( $color eq "blue" ) {
>>print "test\n";
>>last;
>> }
>
> Alternative:
>
> print( "test\n" ), last
> if $color eq "blue";
>
>
> I also see:
>
> print( "test\n" ) and last
> if $color eq "blue";
John Delacour writes:
> What you are saying is rather like expecting meaning from a sentence
It tells you to stop when it's raining and to open your umbrella.
> like:
>
> “Stop if it’s raining, open your umbrella.”
>
> Nobody would know what you intend to say. No condition is actually
> attach
timothy adigun <2teezp...@gmail.com> writes:
> Hi lee,
> Please, check my comment below:
>
> On Sun, Jun 23, 2013 at 3:43 AM, lee wrote:
>
>> James Alton writes:
>>
>> > lee,
>> >
>> > You have a post statement if and then a code block. You can only use one
>> of
>> > two forms:
>> >
>> > print
On 24/6/13 at 06:36, l...@yun.yagibdah.de (lee) wrote:
while($test) {
last if($foo) {
print $bar;
}
else {
print $test;
}
}
doesn't work.
Never mind “doesn’t work”; it doesn’t compile, because
it is plain nonsense syntactically in whatever language.
Compare your meaningless string with the
On 24/06/2013 07:36, lee wrote:
It would be like:
if ( $color eq "blue" ) {
print "test\n";
last;
}
Alternative:
print( "test\n" ), last
if $color eq "blue";
I also see:
print( "test\n" ) and last
if $color eq "blue";
but always question that, because: what if print() f
Hello Lee,
On Mon, 24 Jun 2013 07:36:26 +0200
lee wrote:
> Shlomi Fish writes:
>
> > Hi Lee,
> >
> > On Sun, 23 Jun 2013 04:43:58 +0200
> > lee wrote:
> >
> >> James Alton writes:
> >>
> >> > lee,
> >> >
> >> > You have a post statement if and then a code block. You can only use one
> >> >
Shlomi Fish writes:
> Hi Lee,
>
> On Sun, 23 Jun 2013 04:43:58 +0200
> lee wrote:
>
>> James Alton writes:
>>
>> > lee,
>> >
>> > You have a post statement if and then a code block. You can only use one of
>> > two forms:
>> >
>> > print "test" if $color eq "blue"; #no parenthesis required
>>
On Sun, Jun 23, 2013 at 10:37 AM, Shlomi Fish wrote:
> Hi Tim,
>
> On Sun, 23 Jun 2013 10:21:58 +0100
> timothy adigun <2teezp...@gmail.com> wrote:
>
> > Hi Shlomi,
> >
> >
> > On Sun, Jun 23, 2013 at 10:02 AM, Shlomi Fish >wrote:
> >
> > > Hi Tim,
> > >
> > > just a note.
> > >
> > > On Sun, 23
Hi Tim,
On Sun, 23 Jun 2013 10:21:58 +0100
timothy adigun <2teezp...@gmail.com> wrote:
> Hi Shlomi,
>
>
> On Sun, Jun 23, 2013 at 10:02 AM, Shlomi Fish wrote:
>
> > Hi Tim,
> >
> > just a note.
> >
> > On Sun, 23 Jun 2013 09:39:48 +0100
> > timothy adigun <2teezp...@gmail.com> wrote:
> >
> > >
Hi Shlomi,
On Sun, Jun 23, 2013 at 10:02 AM, Shlomi Fish wrote:
> Hi Tim,
>
> just a note.
>
> On Sun, 23 Jun 2013 09:39:48 +0100
> timothy adigun <2teezp...@gmail.com> wrote:
>
> > Hi lee,
> > Please, check my comment below:
> >
> > On Sun, Jun 23, 2013 at 3:43 AM, lee wrote:
> >
> > > James A
Hi Tim,
just a note.
On Sun, 23 Jun 2013 09:39:48 +0100
timothy adigun <2teezp...@gmail.com> wrote:
> Hi lee,
> Please, check my comment below:
>
> On Sun, Jun 23, 2013 at 3:43 AM, lee wrote:
>
> > James Alton writes:
> >
> > > lee,
> > >
> > > You have a post statement if and then a code bl
Hi ,
On Sun, Jun 23, 2013 at 9:39 AM, timothy adigun <2teezp...@gmail.com> wrote:
> Hi lee,
> Please, check my comment below:
>
> On Sun, Jun 23, 2013 at 3:43 AM, lee wrote:
>
>> James Alton writes:
>>
>> > lee,
>> >
>> > You have a post statement if and then a code block. You can only use
>> on
Hi lee,
Please, check my comment below:
On Sun, Jun 23, 2013 at 3:43 AM, lee wrote:
> James Alton writes:
>
> > lee,
> >
> > You have a post statement if and then a code block. You can only use one
> of
> > two forms:
> >
> > print "test" if $color eq "blue"; #no parenthesis required
> > if($co
Hi Lee,
On Sun, 23 Jun 2013 04:43:58 +0200
lee wrote:
> James Alton writes:
>
> > lee,
> >
> > You have a post statement if and then a code block. You can only use one of
> > two forms:
> >
> > print "test" if $color eq "blue"; #no parenthesis required
> > if($color eq "blue"){print "test";}
>
James Alton writes:
> lee,
>
> You have a post statement if and then a code block. You can only use one of
> two forms:
>
> print "test" if $color eq "blue"; #no parenthesis required
> if($color eq "blue"){print "test";}
And I can't have 'last if $color eq "blue" print "test\n";'? That would
be
Bill,
Below statement wont be helpful for lee, as he has requirement to loop at
least one time.
last if ($counter > 2);
where as below one is working:
if ( $counter > 2) {
print 'if : ' . $counter . "\n"; #could do print "if : $counter\n" as
well
last;
}
On
I think the rest after the 'if' for the last is wrong. either do this:
last if ($counter > 2);
or
if ( $counter > 2) {
print 'if : ' . $counter . "\n"; #could do print "if : $counter\n" as
well
last;
}
On Mon, Jun 17, 2013 at 8:56 AM, lee wrote:
> Hi,
>
> trying to figure out what
lee,
You have a post statement if and then a code block. You can only use one of
two forms:
print "test" if $color eq "blue"; #no parenthesis required
if($color eq "blue"){print "test";}
As far as last, http://perldoc.perl.org/functions/last.html
The example given:
LINE: while () {
i think i got it working correctly. thanks for your help:
my ($ip, $ident, $userid, $time, $cgi, $url, $proto, $status,
$size_tx, $ref, $ua, $size_rx, $re_time) = /^
([-0-9\.]+)\# ip address
(\S+)\ # i
Oops, I found an error my parser. Here's version 1.0.2:
DATA_LOOP:
while( my $line = ){
print $line;
my @captured = ( '' );
my $inside = 0;
CAPTURE_LOOP:
while( 1 ){
if( $line =~ m{ \G ( [^"\\]+ | \\ ["\\] ) }gcx ){
$captured[-1] .= $1 if $inside;
}elsif( $line =~ m{ \G \
On Wed, 21 Nov 2012 20:54:29 -0500
shawn wilson wrote:
> how do i capture all quoted strings?
OK, I rewrote it as a simple parser:
DATA_LOOP:
while( my $line = ){
print $line;
my @captured = ( '' );
my $inside = 0;
CAPTURE_LOOP:
while( 1 ){
if( $line =~ m{ \G ( [^"\\]+ | \\ ["\\
On Wed, 21 Nov 2012 20:54:29 -0500
shawn wilson wrote:
> to match - and sometimes there are spaces before the match, a '\' with
> no '"', etc.
I think you want something like:
while( ){
my @captured = m{ \" ( [^"\\]* (?: \\ ["\\] [^"\\]* )* ) \" }gx;
print;
print "\t$_\n" for @captured
oh, and just to be clear (since i suppose it wasn't by me saying that
i was looking at the regexes in other modules to accomplish this) this
is, as someone else (on this list) once told me "masturbation with
code". i can do what i set off to accomplish but i just wanted more
and it annoyed me that
that's a pretty cool module - i especially like their regex with
lookup table trick. however, since i've got a decently lengthy regex
written to do what i want, and because i'm itching to know how to
actually do this at this point (i'd really like to know what's wrong
with the regex i posted as wel
On Wed, 21 Nov 2012 20:54:29 -0500
shawn wilson wrote:
> how do i capture all quoted strings?
Get Regexp::Common from CPAN and read Regexp::Common::delimited.
http://search.cpan.org/~abigail/Regexp-Common-2011121001/
--
Just my 0.0002 million dollars worth,
Shawn
Programming is
"Vijaya" schreef:
> I think there are 3 possible ways to check the last element in your IF
> condition inside Foreach loop.
>
> 1. $list[-1] eq $element
> 2. $list[$#list] eq $element
> 3. $list[scalar(@list)-1] eq $element
Those all will not work (reliably), because you compare the value, and
th
Hi Dave,
I think there are 3 possible ways to check the last element in your IF
condition inside Foreach loop.
1. $list[-1] eq $element
2. $list[$#list] eq $element
3. $list[scalar(@list)-1] eq $element
See the example code and replace the if with other set of conditions given
above
six24hourdays wrote:
> On Oct 21, 11:06 am, [EMAIL PROTECTED] (Chas. Owens) wrote:
>> On Tue, Oct 21, 2008 at 10:56, David Stiff <[EMAIL PROTECTED]> wrote:
>>>
>>> There probably is a better approach.
>>> I am going through a list of Subversion branch names, e.g.
>>> BRANCH_1
>>> BRANCH_1
>>> BRANC
On Oct 21, 11:06 am, [EMAIL PROTECTED] (Chas. Owens) wrote:
> On Tue, Oct 21, 2008 at 10:56, David Stiff <[EMAIL PROTECTED]> wrote:
> > Hi Chas,
>
> > There probably is a better approach.
>
> > I am going through a list of Subversion branch names, e.g.
>
> > BRANCH_1
> > BRANCH_1
> > BRANCH_2
> > B
"John W. Krahn" schreef:
> six24hourdays:
>> I would like to know how to test for the last element of a list
>> during a foreach loop [...]
>
> You can't because a list does not have a name. [...]
> You can however do it with an array by comparing references:
>
> $ perl -le'
> my @x = "a" .. "z";
six24hourdays wrote:
Hello,
Hello,
I would like to know how to test for the last element of a list during
a foreach loop, e.g.
foreach $element (@List) {
if (this is the last element) {
do something
}
}
What would I use for the IF condition?
You can't because a list does n
On Tue, Oct 21, 2008 at 11:06, Chas. Owens <[EMAIL PROTECTED]> wrote:
snip
> #open my $fh, "-|", "svn somehing"
> # or die "could not run 'svn something': $!";
snip
Whoops, that is what I get for going too fast. The multiple argument
version is faster because it doesn't need to spawn a sub
On Tue, Oct 21, 2008 at 10:56, David Stiff <[EMAIL PROTECTED]> wrote:
> Hi Chas,
>
> There probably is a better approach.
>
> I am going through a list of Subversion branch names, e.g.
>
> BRANCH_1
> BRANCH_1
> BRANCH_2
> BRANCH_2
> BRANCH_3
> BRANCH_3
> BRANCH_4
> BRANCH_4
>
> and checking to see
On Tue, 2008-10-21 at 10:55 -0400, Mr. Shawn H. Corey wrote:
> if( @list ){
> my $last_item = pop @list;
> for my $item ( @list ){
> # do stuff for all items but last
> }
> # do stuff for $last_item
> }
>
If you want @list restored after you're done processing:
if( @list ){
my $las
On Tue, 2008-10-21 at 22:47 +0800, Jeff Pang wrote:
> 2008/10/21 Chas. Owens <[EMAIL PROTECTED]>:
>
> >
> > This is an odd desire; are you sure you really need to do this? Can
> > you tell us what you are trying to achieve? Jeff's answer does what
> > you want, but most likely there is a better
2008/10/21 Chas. Owens <[EMAIL PROTECTED]>:
>
> This is an odd desire; are you sure you really need to do this? Can
> you tell us what you are trying to achieve? Jeff's answer does what
> you want, but most likely there is a better approach to be using for
> your actual problem.
>
Agree.
He pro
On Tue, Oct 21, 2008 at 09:39, six24hourdays <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I would like to know how to test for the last element of a list during
> a foreach loop, e.g.
>
> foreach $element (@List) {
>if (this is the last element) {
>do something
>}
> }
>
> What would I us
2008/10/21 six24hourdays <[EMAIL PROTECTED]>:
> Hello,
>
> I would like to know how to test for the last element of a list during
> a foreach loop, e.g.
>
> foreach $element (@List) {
>if (this is the last element) {
>do something
>}
> }
>
my $i =0;
for (@list) {
if ($i == $#l
"John W. Krahn" schreef:
> tr/\t/ /s;
To also squash adjacent space characters:
tr/\t / /s;
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Andrej Kastrin wrote:
John W. Krahn wrote:
This should do what you want:
#!/usr/bin/perl
use warnings;
use strict;
my $FNI = shift;
my $FNO = "$FNI.dat";
open my $OUT, '>', $FNO or die "Cannot open '$FNO' $!";
open my $IN, '<', $FNI or die "Cannot open '$FNI' $!";
my ( $id, $line );
while
Dear Jonh,
many, many thanks for your quick answer.
I modified your script a bit:
$line .= $_ if /Id|To|From/;
print $OUT "$id\t$line\n" if m!/Note!;
to:
$line .= $_ if m!! .. m!!;
print $OUT "$id\t$line\n" if m!!;
but some problem still persists with the output:
001
001Tho
Andrej Kastrin wrote:
Dear all,
Hello,
to pre-process my XML dataset in run simple Perl script on it, which
extract Id identifier from XML data and paste the whole XML record to
it. For example, the input data looks like:
001
Thomas
Joana
002
> "paul" == paul 0403 <[EMAIL PROTECTED]> writes:
paul> Is there a quick and easy way in perl to get the last entry in a file
paul> for a specific value
paul> For example If I have the following data in a file
paul> 1<\len>
paul> int<\type>
paul> 2<\len>
paul> int<\type>
paul> 3<\len>
paul>
[EMAIL PROTECTED] writes:
> Please keep in mind that the data in the file is only a sample and it
> will not alwasy be the second line from the bottome :-)
>
> I know I can read the file and keep track via a flag of where I am in
> the file but this seems way to over-kill. I was hoping for some ni
Thanks, for all the replys. Didn't know that you could simply reference
the last element of an array by using [-1]. This seemed like it could
be a one line task maybe two, just don't have command of the language.
Peter Scott wrote:
On Tue, 23 Aug 2005 06:17:11 -0700, I wrote:
$last_wor
On Tue, 23 Aug 2005 06:17:11 -0700, I wrote:
> $last_word = (split /\s/, $row->[1]//)[-1];
I seem beset by typos today. Don't know where that // came from. Should
be:
$last_word = (split /\s/, $row->[1])[-1];
--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
--
To u
On Tue, 23 Aug 2005 07:25:05 -0700, Todd Lewis wrote:
> I'm trying to retrieve the last word from an HTML table cell stored in
> an array value.
> All of the words are space delimited.
> I've tried using split /\s/, $$row[1] but this doesn't always return the
> last
> word for me since there cou
On Jun 4, 2005, at 10:39, Johan Meskens CS3 jmcs3 wrote:
hello
i remember there is a terminal command which lists
the last installed perl modules
but i don't remember it well enough to actually know it
Perhaps you mean
perldoc perllocal
?
-- fxn
--
To unsubscribe, e-mail: [EMAIL PRO
David Gilden wrote:
Dear fellow PERL coders...,
Hello,
What is the "&& do" part of the code doing, i.e. I am looking to understand the
syntax,
the example was found in perl beginners archive, from some else's post...
&& is the logical 'and' operator. If the expression on its left is
evaluated
as
Sorry for my English :)
'&&' is a boolean operator.
It returns TRUE when both statemets are ture, and false on other cases.
But if the first statement is false, next statement will not be executed.
For example:
$hash{key} doesn't exists -
if(exists($hash{key}) && $hash{key} =~ /\d+/);
Is $^W is tru
F H wrote:
Gunnar Hjalmarsson wrote:
F H wrote:
I have a directory where log files are saved in on a daily basis by
a VB program. and what I need is a way to get the last file stored
into that directory. The last modified file in that directory
should do it.
perldoc -f stat
What I am looking
Note: forwarded message attached.
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!--- Begin Message ---
Thanks Gunnar for responding
What I am looking for is how "code wise" find the last modified file in a directory within a script. here us my script
use MIME::Lite;use Net::SMT
F H wrote:
I have a directory where log files are saved in on a daily basis by
a VB program. and what I need is a way to get the last file stored
into that directory. The last modified file in that directory
should do it.
perldoc -f stat
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin
C:\>perldoc -f pop
pop ARRAY
pop Pops and returns the last value of the array, shortening the
array by one element. Has an effect similar to
$ARRAY[$#ARRAY--]
If there are no elements in the array, returns the undefined
value (althou
Hi,
You can use
my $LastValue = $ARRAY[ $#ARRAY-1 ];
The pop function suppress the last value of the ARRAY.
Michel
-Message d'origine-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Date: vendredi 8 août 2003 12:57
À: [EMAIL PROTECTED]
Objet: Last value in a array?
Hi,
I have a c
";
Output:
4
5
-Original Message-
From: EUROSPACE SZARINDAR [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 1:40
PM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: Last value in a array?
Hi,
You can use
my $LastValue = $ARRAY[ $#ARRAY-1 ];
The pop fu
[EMAIL PROTECTED] wrote:
> Hi,
>
> I have a couple of arrays which have different number of
> values - I need only the last value in each - are there a command to
> do that?
>
> e.g
>
> $array[LAST] :-)
Negative subscripts count from the end of the array, so the last element is:
$array[-1
[mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 2:00 PM
To: 'Leon'; 'Tillman, James'; 'Robert-Jan Mora'
Cc: 'perl'; 'win32'; 'Yahoo Beginner Perl'
Subject: RE: Last Logon of ALL users in the domain
If you want the Time of logon
> On Tuesday, June 24, 2003 at 4:15 PM, Dan Muey stated:
> :
> : This is last post for me today I swear!!!
>
> But . . .
>
> On Tuesday, June 24, 2003 at 4:38 PM, Dan Muey posted:
>
> : Cool, Thanks again Jenda, it's coming slowly,
> : bit by bit.
>
>
> Just can't trust that guy!
On Tuesday, June 24, 2003 at 4:15 PM, Dan Muey stated:
:
: This is last post for me today I swear!!!
But . . .
On Tuesday, June 24, 2003 at 4:38 PM, Dan Muey posted:
: Cool, Thanks again Jenda, it's coming slowly,
: bit by bit.
Just can't trust that guy! :)
Charles K. Clarkson
--
Cool, Thanks again Jenda, it's coming slowly, bit by bit.
Have a good one!
> From: "Dan Muey" <[EMAIL PROTECTED]>
> > Suppose I have a module:
> >
> > package MyConfig;
> >
> > use strict;
> > use warnings;
> >
> > use CGI qw(:standard); # or user_name or one then other if
> fail? use
> > DB
From: "Dan Muey" <[EMAIL PROTECTED]>
> Suppose I have a module:
>
> package MyConfig;
>
> use strict;
> use warnings;
>
> use CGI qw(:standard); # or user_name or one then other if fail?
> use DBI;
>
> use base 'Exporter';
> use Carp;
>
>
> Now in the script I have
>
> #!/usr/bin/perl
>
] Behalf Of Leon
Sent: Thursday, June 12, 2003 12:03 PM
To: Tillman, James; Robert-Jan Mora
Cc: perl; win32; Yahoo Beginner Perl
Subject: RE: Last Logon of ALL users in the domain
This totally 100 percent worked.
Thank you so much
"Tillman, James" <[EMAIL PROTECTED]> wrote:
AIL PROTECTED]
Sent: Thursday, June 12, 2003 1:22 PM
To: '[EMAIL PROTECTED]'; 'Leon'; 'Tillman, James';
'Robert-Jan Mora'
Cc: 'perl'; 'win32'; 'Yahoo Beginner Perl'
Subject: RE: Last Logon of ALL users in the domain
Is
{Name} . "=" . $last_login . "\n"
}
}
Just a thought...
jpt
-Original Message-
From: Leon [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 12:35 PM
To: Robert-Jan Mora
Cc: perl; win32; Yahoo Beginner Perl
Subject: Re: Last Logon of ALL users in the domain
Hi Rober
Hi Robert,
Unfortunately after examining this script it works via passing a username to it. I
can do this with adminmisc. I need to check ALL users in the domain.
Here is a snippet of the code and what it appears to do:
$username = $ARGV[0];
Grab the username from ARGV
I appreciate the
NTDISABLE) >= 0){
print OUTFILE "DISABLED.";
$total = $total - UF_ACCOUNTDISABLE;
}
if (($total - UF_SCRIPT) >= 0){
$total = $total - UF_SCRIPT;
}
if($user{passwordExpired} == 1){
print OUTFILE
1 - 100 of 144 matches
Mail list logo