Hallo
I have an array
@Treasures
and I want to match anywhere in it for
/:1:2:3:/
can I
if (@Treasures =~ /:1:2:3:/){}
or do i have to change (@Treasures to $Treasures and then
$Treasures = @Treasures ;
if ($Treasures =~ /:1:2:3:/){}
Just thought I'd ask first, I have to take mother in law to Dr.
Good afternoon all,
I am new to Perl, so I ask you in advance for your indulgences.
I have a file of 82,000 lines in a fixed format of 130 characters on
each line, with a line feed.
Given the layout:
Field1 = Position 1-5
Field2 = Position 6-20
Field3 = Position 21-30
and so on and so on f
Good afternoon all,
I am new to Perl, so I ask you in advance for your indulgences.
I have a file of 82,000 lines in a fixed format of 130 characters on
each line, with a line feed.
Given the layout:
Field1 = Position 1-5
Field2 = Position 6-20
Field3 = Position 21-30
and so on and so on f
Gladstone Daniel - dglads wrote:
Good afternoon all,
Hello,
I am new to Perl, so I ask you in advance for your indulgences.
I have a file of 82,000 lines in a fixed format of 130 characters on
each line, with a line feed.
Given the layout:
Field1 = Position 1-5
Field2 = Position 6-20
F
Chas. Owens wrote:
On Thu, Apr 10, 2008 at 1:42 AM, nag <[EMAIL PROTECTED]> wrote:
hi,
please help me to get all the files present in a directory which are
created/accessed in last 4 hours .
snip
Take a look at File::Find* and the stat function** or -M***. You may
also want to read
On Thu, Apr 10, 2008 at 1:07 AM, Lou Hernsen <[EMAIL PROTECTED]> wrote:
> Hallo
>
> I have an array
> @Treasures
> and I want to match anywhere in it for
> /:1:2:3:/
> can I
> if (@Treasures =~ /:1:2:3:/){}
> or do i have to change (@Treasures to $Treasures and then
> $Treasures = @Treasure
[EMAIL PROTECTED] into the middle of @players without removing any elements
from @players.
so i've done the following...
#!/usr/bin/perl -w
# extracting elements using splice
@players = ("ryno", "fukudome", "grace", "banks", "santo",
"soto", "marmol", "sori", "bigZ", "pie");
@dump =
Hi,
How about this :-
foreach (@Treasures){
if ($_=~ /:1:2:3:/){
print "do your stuffs here\n":
}
}
- Original Message -
From: "Lou Hernsen" <[EMAIL PROTECTED]>
To: ; <[EMAIL PROTECTED]>
Sent: Thursday, April 10, 2008 1:07 AM
Subject: Testing an array for a match
Hallo
On Wed, Apr 9, 2008 at 3:14 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] into the middle of @players without removing any elements
> from @players.
>
> so i've done the following...
>
> #!/usr/bin/perl -w
>
> # extracting elements using splice
>
> @players = ("ryno", "f
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] into the middle of @players without removing any elements
from @players.
so i've done the following...
#!/usr/bin/perl -w
# extracting elements using splice
@players = ("ryno", "fukudome", "grace", "banks", "santo",
"soto", "marmol", "sor
> "Richard" == Richard Lee <[EMAIL PROTECTED]> writes:
Richard> Just out of curiosity to all perl experts in here...
Richard> how many times did you guys read entire perl FAQs ?
Every time one of you says something that sounds like a FAQ.
:-)
But seriously, I still skim the FAQ headlines a
Hi, I have a ~125MB file of which I want to read lines n thru n+x and write
those into a separate file. What is the best way to go about this?
thanks
On Apr 10, 2008, at 18:24 , Jonathan Mast wrote:
Hi, I have a ~125MB file of which I want to read lines n thru n+x
and write
those into a separate file. What is the best way to go about this?
Tie::File
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PRO
I think a simpler solution would be to use head and tail:
head -n x > file.txt
tail -n x-n file.txt > file2.txt
Xavier Noria wrote:
On Apr 10, 2008, at 18:24 , Jonathan Mast wrote:
Hi, I have a ~125MB file of which I want to read lines n thru n+x and
write
those into a separate file. What
On Thu, Apr 10, 2008 at 12:24 PM, Jonathan Mast
<[EMAIL PROTECTED]> wrote:
> Hi, I have a ~125MB file of which I want to read lines n thru n+x and write
> those into a separate file. What is the best way to go about this?
>
> thanks
>
Use the flip-flop operator* (..):
perl -ne 'print if $. ==
or use head and tail command
head -n50 file | tail -n30
On Thu, Apr 10, 2008 at 11:54 AM, Chas. Owens <[EMAIL PROTECTED]> wrote:
> On Thu, Apr 10, 2008 at 12:24 PM, Jonathan Mast
> <[EMAIL PROTECTED]> wrote:
> > Hi, I have a ~125MB file of which I want to read lines n thru n+x and
> write
> > t
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] into the middle of @players without removing any elements
from @players.
so i've done the following...
#!/usr/bin/perl -w
# extracting elements using splice
@players = ("ryno", "fukudome", "grace", "banks", "santo",
"soto", "marmol", "sor
Jonathan Mast wrote:
Hi,
Hello,
I have a ~125MB file of which I want to read lines n thru n+x and write
those into a separate file. What is the best way to go about this?
while ( ) {
# read and ignore up to n
last if $. == $n - 1;
}
while ( ) {
print;
last if $. == $
Chas. Owens wrote:
On Thu, Apr 10, 2008 at 12:24 PM, Jonathan Mast
<[EMAIL PROTECTED]> wrote:
Hi, I have a ~125MB file of which I want to read lines n thru n+x and write
those into a separate file. What is the best way to go about this?
Use the flip-flop operator* (..):
perl -ne 'print if $
Randal L. Schwartz wrote:
"Richard" == Richard Lee <[EMAIL PROTECTED]> writes:
Richard> Just out of curiosity to all perl experts in here...
Richard> how many times did you guys read entire perl FAQs ?
Every time one of you says something that sounds like a FAQ.
:-)
But serious
> -Original Message-
> From: Chas. Owens [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 09, 2008 13:05
> To: Wagner, David --- Senior Programmer Analyst --- WGO
> Cc: beginners@perl.org
> Subject: Re: Example of FTP w/o Input file? Is it possible to
> do or not?
>
> On Wed, Apr 9, 20
Hi,
I am currently learning perl programming. Please help me by giving
some practice exercises or direct me to the site where i can find
them.
Thanks in Advance!
Hemanth
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Is there a good debugger for perl. I have an application running on
Ubuntu , with apache and mod perl along with mysql. and we are into
reverse engineering the product. And need to debug the code. Is there
any debugger for perl other than the internal debugger which we can
use other than perl inbui
Yeah...I actually figured it out last night, and couldn't find my post to
send out the correction. but thanks for the assistance.
my final code looks like this..
#!/usr/bin/perl -w
# extracting elements using splice
@players = ("ryno", "fukudome", "grace", "banks", "santo",
"soto",
On Thu, Apr 10, 2008 at 5:56 AM, hemanth <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am currently learning perl programming. Please help me by giving
> some practice exercises or direct me to the site where i can find
> them.
snip
A good starting exercise is reimplementing various UNIX utilities in
On Thu, Apr 10, 2008 at 6:44 AM, jeevs <[EMAIL PROTECTED]> wrote:
> Is there a good debugger for perl. I have an application running on
> Ubuntu , with apache and mod perl along with mysql. and we are into
> reverse engineering the product. And need to debug the code. Is there
> any debugger for
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of zentara
> Sent: Thursday, April 10, 2008 9:31 AM
> To: beginners@perl.org
> Subject: Re: Sometimes Net::SSH2 can't read() from channel?
>
> On Wed, 9 Apr 2008 17:20:06 -0400, [EMAIL PROTECTED] ("RIC
On Apr 10, 9:03 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
> [EMAIL PROTECTED] wrote:
> > [EMAIL PROTECTED] into the middle of @players without removing any elements
> > from @players.
>
> > so i've done the following...
>
> > #!/usr/bin/perl -w
>
> > # extracting elements using splice
>
> >
or use sed!
To print lines 5 through 10:
sed -ne '5,10p'
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Thanks for all the input.
The head / tail solution would work, but isn't very scalable. I did
something similar on another file of comparable size and it took a long time
to complete.
The line numbers are 4million to 4million + some odd hundred thousand, just
to give an idea of the size.
The se
Thanks for the assistance. This is what I ended up doing. The hash is
much faster and I am getting what I require in my two output files. My
mhs file has over 26 columns and is over 27,000 lines.
#!/usr/bin/perl
$file="/adsm/CRONJOBS/MHS/nodes_cleanedup";
$mhs="/adsm/CRONJOBS/MH
On Thu, Apr 10, 2008 at 4:35 PM, Jonathan Mast
<[EMAIL PROTECTED]> wrote:
> Thanks for all the input.
>
> The head / tail solution would work, but isn't very scalable. I did
> something similar on another file of comparable size and it took a long time
> to complete.
>
> The line numbers are 4
Thanks Jenda, Chas.Owens and fellow members.
What do you mean by "globalise"?
Jenda
Looking at the script below, in diagram 1, $capital will not be incremented
unless I write it as in diagram 2.
Just because I do not want $capital to be reset on each foreach loop, I then
have to declare $cap
Hi Members,
1)The script below produce the following warnings:- "variable
$betting_system will not stay shared at roulette.pl line 61."
What is the problem and how do I rectify this problem.
2)How do I shorten/improve this script.
Thanks
# start of script #
Something like
...
{
my $cnt;
sub inc {
return ++$cnt;
}
}
print inc(),"\n";
print inc(),"\n";
print inc(),"\n";
Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed
to get drunk and c
From: <[EMAIL PROTECTED]>
> Hi Members,
> 1)The script below produce the following warnings:- "variable
> $betting_system will not stay shared at roulette.pl line 61."
>What is the problem and how do I rectify this problem.
Don't write a named subroutine within another named subrouti
From: jeevs <[EMAIL PROTECTED]>
> Is there a good debugger for perl. I have an application running on
> Ubuntu , with apache and mod perl along with mysql. and we are into
> reverse engineering the product. And need to debug the code. Is there
> any debugger for perl other than th
[EMAIL PROTECTED] wrote:
Thanks Jenda, Chas.Owens and fellow members.
What do you mean by "globalise"?
Jenda
Looking at the script below, in diagram 1, $capital will not be
incremented unless I write it as in diagram 2.
Just because I do not want $capital to be reset on each foreach loop, I
Johnson, Reginald (GTI) wrote:
> Thanks for the assistance. This is what I ended up doing. The hash is
> much faster and I am getting what I require in my two output files. My
> mhs file has over 26 columns and is over 27,000 lines.
>
> #!/usr/bin/perl
Always
use strict;
use warnings;
and a
Learning Perl has exercises after each charpter.
On 4/10/08, hemanth <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am currently learning perl programming. Please help me by giving
> some practice exercises or direct me to the site where i can find
> them.
>
> Thanks in Advance!
>
> Hemanth
>
>
> --
> To
[EMAIL PROTECTED] wrote:
Hi Members,
Hello,
2)How do I shorten/improve this script.
You could try it like this:
# start of script #
use strict;
use warnings;
use List::Util qw/ shuffle /;
my %config = (
number_of_games=> 5_000,
capital
41 matches
Mail list logo