try:
perl -ne '$line=$_;END{print $line}' yourfile
On Mon, 25 Jul 2005 19:09:50 +0530
[EMAIL PROTECTED] wrote:
hi ,
I am a perl newbie.
Can someone suggest a perl command line snippet that will print the last n
lines of a file.
thanks in advance.
regards,
Kaushik
Notice:
On Sun, 12 Jun 2005 11:49:37 -0700 (PDT)
Christopher Spears [EMAIL PROTECTED] wrote:
I am trying to update a script I wrote to automate
g++. Here is an excerpt:
#!/bin/perl -w
use strict;
my $number_of_args = @ARGV;
open STDERR, ./caught_errors or die Can't create
caught_errors:
The following code may be not simple:
===code===
#!/usr/bin/perl
use warnings;
use strict;
my %hash = (abc=mallik,xyz=ariun,mno=priya);
my %hash2 = (abc=123,xyz=243,mno=532);
foreach (keys %hash2) {
$hash{$hash2{$_}} = $hash{$_};
delete $hash{$_};
}
foreach (keys %hash) {
print $_ ==
perldoc -f glob maybe will help:
On Tue, 7 Jun 2005 14:13:29 -0700
Vladimir Lemberg [EMAIL PROTECTED] wrote:
glob (*.vsn)
--
Whatever you do will be insignificant,but
the important is you do it!
It doesn't matter who you are, it's what
you do that takes you far!
--
To unsubscribe,
Or you can try:
__BEGIN__
#!/usr/bin/perl
use warnings;
use strict;
my @decimals;
$_ = 'atom 12 N VAL A 1 12.435 13.66 34.6 32.1 32 a N';
push @decimals,$1 while (/(\d+\.?\d*)/g);
print @decimals\n;
__END__
On Mon, 9 May 2005 19:04:08 +0530
Aditi Gupta [EMAIL PROTECTED] wrote:
Hi
On Tue, 10 May 2005 09:22:31 +0200
John Doe [EMAIL PROTECTED] wrote:
my @decimals= /(\d+\.?\d*)/g;
cool! Thanks!
--
Whatever you do will be insignificant,but
the important is you do it!
It doesn't matter who you are, it's what
you do that takes you far!
--
To unsubscribe, e-mail: [EMAIL
On Thu, 21 Apr 2005 08:31:27 +0300
Offer Kaye [EMAIL PROTECTED] wrote:
On 4/21/05, FreeFall wrote:
3. But there's an even easier way, without having to use map:
my @record = split /\s*\|\s*/,$date;
--this seems it cant delete spaces of the last element.
Have you tried
On Thu, 21 Apr 2005 10:06:24 +0300
Offer Kaye [EMAIL PROTECTED] wrote:
On 4/21/05, FreeFall wrote:
Sure I did with Paul's example data :
$date = 'one | two |three |';
And I tried to change the regx /\s*\|\s*/ to /s*\|?\s*/ and it worked. What
do you think?
I think that's
On Wed, 20 Apr 2005 17:04:50 +0300
Offer Kaye [EMAIL PROTECTED] wrote:
On 4/20/05, Paul Kraus wrote:
Why does this work
my $date = 'one | two |three |';
my @record = map ( whitespace($_), (split /\|/,$_) );
No, it won't work - you need to replace the $_ at the end with
I am new to Perl too and have a little try:
#!/usr/bin/perl
use warnings;
use strict;
my @data;
while () {
chomp;
push @data,$_ if !/^\/;
}
On Mon, 28 Mar 2005 15:49:38 -0500
Daniel Smith [EMAIL PROTECTED] wrote:
Hi all,
I'm brand new to Perl, and have just a
10 matches
Mail list logo