Patricia Hinman wrote:
>
> Does anyone know of a routine that will sort arrays by
> size. I need to sort any number of given arrays, and
> operate on the largest to the smallest.
>
> I've just recently learned of the
> @nums = sort{$a<=>$b} @numbers;
>
> hope the answer for arrays is as simple
David Carpenter wrote:
>
> This is a list for beginners, right? So perhaps no one will be too annoyed
> if I ask what is probably a really stupid question . . .
>
> I have a text file with occasional strings enclosed in braces:
> kdkdkiwiwdkdkdk {iwidkwidkw} kdkdkdwiwiwkdkdk . . .
>
> I would
On Sunday, July 7, 2002, at 10:03 PM, bob ackerman wrote:
>
> On Monday, July 8, 2002, at 12:55 AM, Todd Wade wrote:
>
>>
>> "David Carpenter" <[EMAIL PROTECTED]> wrote in message
>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>
>>> I have a text file with occasional strings enclosed in brac
"Bob Ackerman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On Monday, July 8, 2002, at 12:46 AM, Todd Wade wrote:
>
> >
> > "Patricia Hinman" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> Does anyone know of a
On Monday, July 8, 2002, at 12:55 AM, Todd Wade wrote:
>
> "David Carpenter" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>> I have a text file with occasional strings enclosed in braces:
>> kdkdkiwiwdkdkdk {iwidkwidkw} kdkdkdwiwiwkdkdk . . .
>>
>> I wou
On Monday, July 8, 2002, at 12:46 AM, Todd Wade wrote:
>
> "Patricia Hinman" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Does anyone know of a routine that will sort arrays by
>> size. I need to sort any number of given arrays, and
>> operate on the l
"David Carpenter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a text file with occasional strings enclosed in braces:
> kdkdkiwiwdkdkdk {iwidkwidkw} kdkdkdwiwiwkdkdk . . .
>
> I would like to use tr/// to modify the characters within the braces,
whi
Hi Patricia,
Whilst this does not answer your question in full it should act as a
starting point.
@array = qw(1 2 3 4); # four elements
print $#array+1; # will print 4
HTH
Toby
"Patricia Hinman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Does anyone kn
"Patricia Hinman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Does anyone know of a routine that will sort arrays by
> size. I need to sort any number of given arrays, and
> operate on the largest to the smallest.
>
> I've just recently learned of the
> @n
"Janek Schleicher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Todd Wade wrote at Sat, 06 Jul 2002 21:25:24 +0200:
>
> >
> > I might use something like this:
> >
> > #!/usr/bin/perl -w
>
> I would be too lazy to write my own random_string subroutine.
>
Does anyone know of a routine that will sort arrays by
size. I need to sort any number of given arrays, and
operate on the largest to the smallest.
I've just recently learned of the
@nums = sort{$a<=>$b} @numbers;
hope the answer for arrays is as simple.
Thanks Tricia
[EMAIL PROTECTED]
_
This does sound like an ideal job for Perl, but I think you need to give us
more info on what you want to do. For instance, translate all 'i's inside
the braces to 'x's, or substitute one sequence of characters for another. An
example or scenario would be helpful here.
-- John
# -Original Me
This is a list for beginners, right? So perhaps no one will be too annoyed
if I ask what is probably a really stupid question . . .
I have a text file with occasional strings enclosed in braces:
kdkdkiwiwdkdkdk {iwidkwidkw} kdkdkdwiwiwkdkdk . . .
I would like to use tr/// to modify the characte
Vargas Media wrote:
>
> Hi All,
Hello,
> I am new to Perl and I have been grabbing code here and there to make a
> search engine for a site. - Posted below.
> What I have works but is incredibly slow and doesn't report back when a
> match is not found.
> I have been working with "CGI Programmin
From: Kevin Pfeiffer <[EMAIL PROTECTED]>
> > my $test = "Rnott230602.txt";
> > if ( $test =~ m/^(.{1})(.{4})(.{6})\.(.{3})$/ ) {
>
> What is the difference between "if ( $test =~ m/...)"
> and "if ( $test =~ /...)" (without the "m")? (If any?)
None. The "m" just allows you to use a different d
From: "Mariusz" <[EMAIL PROTECTED]>
> Can I set it and then check if it was created within the same script?
> M
>
> > You just set one on one page and test whether it's set on the next
> > one.
No.
You need to send a page to the client with the cookie "attached" and
see if it's sent by the cl
Can I set it and then check if it was created within the same script?
M
> You just set one on one page and test whether it's set on the next
> one.
>
> Jenda
> === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
> There is a reason for living. There must be. I've seen it somewh
Hi from an (until now) silent list reader,
Nigel Peck writes:
> I probably should have explained what this is doing, the match m// takes
> the string in $test and (using the parenthesis for capturing), puts the
> first character in $1, the second 4 characters in $2...
[...]
Such explanations are
Nice. Short and sweet. I am still into a strong type approach for
variables rather than let Perl fill in the blanks.
On Sun, 7 Jul 2002 16:33:56 +0800, [EMAIL PROTECTED] (Connie Chan)
wrote:
>How about this ?
>
>my $in = 20020706;
>my @months = ('', Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, O
Hi All,
I am new to Perl and I have been grabbing code here and there to make a
search engine for a site. - Posted below.
What I have works but is incredibly slow and doesn't report back when a
match is not found.
I have been working with "CGI Programming with Perl" from O'Rielly but,
haven't had
At 09:33 AM 7/6/02 -0500, David T-G wrote:
>I want to add to $ENV{'PATH'} in the parent process from my script.
>Generally I know this isn't allowed, but I wonder if there's a way to do
>it.
No. It's a Unix FAQ and Perl can't do it any more than any other
language. See 2.8 in http://www.faqs.o
Bob, et al --
...and then bob ackerman said...
%
% On Sunday, July 7, 2002, at 05:47 AM, David T-G wrote:
%
...
% > # $_[0] =~ /tcsh/ && $setenv = "setenv" ;
% > # $_[0] =~ /tcsh/ && { $setenv = "setenv" ; } ;
% > # $_[0] =~ /tcsh/ && { $setenv = 'setenv' ; } ;
% > # if $_[0] =~ /tcsh/
From: PayalR <[EMAIL PROTECTED]>
> I am quite new to perl. I heard that there is an application, which
> converts perl programs into binary executables one. Can any one tell
> me about those kind of programs? I would like to have a full working
> freeware program. Thanks a lot in advance and waiti
> Is there a way to check if the person accepts cookies?
>
> thanks.
> M
You just set one on one page and test whether it's set on the next
one.
Jenda
=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's
On Sunday, July 7, 2002, at 05:47 AM, David T-G wrote:
> Hi, all --
>
> It must still be early, because I just don't get this.
>
> Given the snippet
>
> sub setpath(my $shelltype)
> {
> my ($setenv,$equals) ;
> # $_[0] =~ /tcsh/ && $setenv = "setenv" ;
> # $_[0] =~ /tcsh/ && { $se
Hi, all --
It must still be early, because I just don't get this.
Given the snippet
sub setpath(my $shelltype)
{
my ($setenv,$equals) ;
# $_[0] =~ /tcsh/ && $setenv = "setenv" ;
# $_[0] =~ /tcsh/ && { $setenv = "setenv" ; } ;
# $_[0] =~ /tcsh/ && { $setenv = 'setenv' ; } ;
#
I don't know, I guess 1 is a return of "true" signal.
However, for your purpose, use sprintf will solve your
problem.
Rgds,
Connie
- Original Message -
From: "Zachary Buckholz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 07, 2002 2:19 PM
Subject: number 1 showing up in
Hello Zachary,
On Sat, Jul 06, 2002 at 11:19:58PM -0700, Zachary Buckholz wrote:
> Odd extra '1' showing up? Can someone explain this.
> my $current_date = printf("%04d-%02d-%02d", $year+1900, $month+1, $day);
^^
The problem lies here. You have to use sprintf to get a
Odd extra '1' showing up? Can someone explain this.
#!/usr/local/bin/perl -w
my $current_date = getdate();
print "$current_date\n";
exit();
sub getdate {
my ($day, $month, $year) = (localtime)[3,4,5];
my $current_date = printf("%04d-%02d-%02d", $year+1900, $month+1, $day);
return($current_d
How about this ?
my $in = 20020706;
my @months = ('', Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov,
Dec);
my $out = "$months[$2] $3, $1" if ( $in =~ /(\d{4})(\d{2})(\d{2})/);
Rgds,
Connie
- Original Message -
From: "John W. Krahn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
30 matches
Mail list logo