Try using the "\b" character to erase your output.
-Original Message-
From: Trent Rigsbee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 5:06 PM
To: [EMAIL PROTECTED]
Subject: Counting (easy!)
I'm sure this is easy but I'm a newbie. I was doing control statements
(for,
wh
Trent Rigsbee wrote:
> I'm sure this is easy but I'm a newbie. I was doing control statements
> (for, while,etc.) like this:
>
> for ($count = 1; $count <= 5; $count++) {
> print "$count\n";
> }
>
> What I wanted to do was to make each number appear in s
On Wed, 2003-11-12 at 20:05, Trent Rigsbee wrote:
> I'm sure this is easy but I'm a newbie. I was doing control statements (for,
> while,etc.) like this:
>
> for ($count = 1; $count <= 5; $count++) {
> print "$count\n";
> }
>
> What I wanted to do was to
On Wednesday, Nov 12, 2003, at 18:07 US/Pacific, david wrote:
[..]
like count down from 5 to 1 slowly in a single row? try:
[panda]# perl -e '$|=1; print " @{[6-$_]}\r" and sleep(1) for(1..5)'
david
Minor Nit, that "\r" will not actually go out
54321
rather pleasantly returns the cursor to the
On Thu, 13 Nov 2003 01:05:37 +, Trent Rigsbee wrote:
> for ($count = 1; $count <= 5; $count++) {
> print "$count\n";
> }
This is very C'ish. In Perl we tend to:
for ( 1..5 ) {
print $_ . "\n";
# sleep( 1 );
}
Uncomment the sleep() thing if you want Perl to sleep for 1 se
Trent Rigsbee wrote:
>
> I'm sure this is easy but I'm a newbie. I was doing control statements (for,
> while,etc.) like this:
>
> for ($count = 1; $count <= 5; $count++) {
> print "$count\n";
> }
In Perl that is usually written as:
for $count ( 1 .. 5
> In Perl that is usually written as:
>
> for $count ( 1 .. 5 ) {
> print "$count\n";
> }
Or even easier:
for(1..5) { print; }
Or if you nee the newline:
for(1..5) { print "$_\n"; }
HTH
DMuey
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTE
Dan Muey wrote:
>
> >
> > In Perl that is usually written as:
> >
> > for $count ( 1 .. 5 ) {
> > print "$count\n";
> > }
>
> Or even easier:
> for(1..5) { print; }
> Or if you nee the newline:
> for(1..5) { print "$_\n"; }
If we're competing, then there's
print for 1..5
;)
Rob
--
To
On Thu, 13 Nov 2003 09:05:45 -0600, Dan Muey wrote:
>> In Perl that is usually written as:
>>
>> for $count ( 1 .. 5 ) {
>> print "$count\n";
>> }
> Or even easier:
> for(1..5) { print; }
Or _even_ easier;
print 1..5;
Hah! :-)
--
Tore Aursand <[EMAIL PROTECTED]>
--
To unsubscribe,
Tore Aursand wrote:
>
> On Thu, 13 Nov 2003 09:05:45 -0600, Dan Muey wrote:
> >> In Perl that is usually written as:
> >>
> >> for $count ( 1 .. 5 ) {
> >> print "$count\n";
> >> }
>
> > Or even easier:
> > for(1..5) { print; }
>
> Or _even_ easier;
>
> print 1..5;
For the subscribers who d
Rob Dixon wrote:
>
> Tore Aursand wrote:
> >
> > On Thu, 13 Nov 2003 09:05:45 -0600, Dan Muey wrote:
> > >> In Perl that is usually written as:
> > >>
> > >> for $count ( 1 .. 5 ) {
> > >> print "$count\n";
> > >> }
> >
> > > Or even easier:
> > > for(1..5) { print; }
> >
> > Or _even_ easier;
On Thu, Nov 13, 2003 at 12:09:24PM -0800, John W. Krahn wrote:
> Rob Dixon wrote:
> > For the subscribers who don't already know,
> > what are the differences between my
> >
> > print for 1..5
>
> for iterates over the list 1..5 and sets $_ with each value and then
> print is called for each it
John W. Krahn wrote:
>
> >
> > For the subscribers who don't already know,
> > what are the differences between my
> >
> > print for 1..5
>
> for iterates over the list 1..5 and sets $_ with each value and then
> print is called for each item and print out the value in $_.
>
> > and Tore's
> >
>
Steve Grazzini wrote:
>
> On Thu, Nov 13, 2003 at 12:09:24PM -0800, John W. Krahn wrote:
> > Rob Dixon wrote:
> > > For the subscribers who don't already know,
> > > what are the differences between my
> > >
> > > print for 1..5
> >
> > for iterates over the list 1..5 and sets $_ with each value
Steve Grazzini wrote:
>
> On Thu, Nov 13, 2003 at 12:09:24PM -0800, John W. Krahn wrote:
> > Rob Dixon wrote:
> > > For the subscribers who don't already know,
> > > what are the differences between my
> > >
> > > print for 1..5
> >
> > for iterates over the list 1..5 and sets $_ with each value
I have a list of email addresses in a text file one to a line. How would I
seach for a particular email address?
$email = "[EMAIL PROTECTED]";
while {
if ($email eq $_) {
$OK = 1;
}
}
It seems the @ symbol somehow doesn't work in this search. What would be a
better (or right) way t
On Thu, Nov 13, 2003 at 09:16:59PM -, Rob Dixon wrote:
> Steve Grazzini wrote:
>> This is a documented optimization w/r/t foreach() loops, but the same
>> thing applies to the foreach() modifier.
>
> What the code is optimised to is a touch OT, but I've never seen this
> documented Steve. Can
On Thu, 13 Nov 2003 16:19:32 -0500, Jimstone77 wrote:
> I have a list of email addresses in a text file one to a line. How would I
> seach for a particular email address?
>
> $email = "[EMAIL PROTECTED]";
>
> while {
>if ($email eq $_) {
> $OK = 1;
>}
> }
Doesn't this work? I wou
> -Original Message-
> From: Tore Aursand [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 13, 2003 3:50 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Counting (easy!)
>
>
> On Thu, 13 Nov 2003 16:19:32 -0500, Jimstone77 wrote:
> > I have a list of email add
You need to escape the '@' in your variable:
/***
open(FILE, "
$email = "[EMAIL PROTECTED]";
while () {
print;
print if (/$email/);
# $OK = 1 if /$email/;
}
*/
At 04:19 PM 11/13/03 -0500, you wrote:
I have a list of email addresses in a text file one to a line.
Steve Grazzini wrote:
> > What do you think is happening under the hood for something like
> >
> > print for (0..0, 1, 2..5, func(6)..func(99))
>
> I think the whole list would have to be generated. The optimization
> only applies to the case where there's just one range in place of the
> LIST.
I think I figured it out! A FIRST!!
for ($i = 1; $i <= 5; $i++){
sleep 1;
print "$i\n";
}
I prints out like this: 1...2...3...4...5
YES!!
Thanks everyone! :-)
From: "Trent Rigsbee" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Counting (easy!)
Date: Thu, 13 Nov 2003 01:0
Wouldn't that print out
1
2
3
4
5
?
-Original Message-
From: Trent Rigsbee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 6:13 PM
To: [EMAIL PROTECTED]
Subject: Re: Counting (easy!) (YES!!)
I think I figured it out! A FIRST!!
for ($i = 1; $i <= 5; $i++){
Trent Rigsbee <[EMAIL PROTECTED]> wrote:
:
: I think I figured it out! A FIRST!!
:
: for ($i = 1; $i <= 5; $i++){
: sleep 1;
: print "$i\n";
: }
As you move into larger programs and scripts it
is a good idea to always use strict and warnings.
use strict;
use warnings;
After
quite interesting chunk of code - but what the hell does select does here?
Yeah - I rtfm - but didn't understand it - maybe one could explain it in
more simple words?
Jane
Kevin Old wrote:
What I wanted to do was to make each number appear in sequence like you see
in a countdown (or up, in
Christiane Nerz wrote:
> Kevin Old wrote:
> ...
> > select undef, undef, undef, 0.25 or print $_
> > for 1 .. 5;
> ...
> quite interesting chunk of code - but what the hell does select does
> here? Yeah - I rtfm - but didn't understand it - maybe one could
> explain it in more simple words?
It's
"Bob Showalter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Christiane Nerz wrote:
> > Kevin Old wrote:
> > ...
> > > select undef, undef, undef, 0.25 or print $_
> > > for 1 .. 5;
> > ...
> > quite interesting chunk of code - but what the hell does select does
> > here? Yeah -
On Thu, 2003-11-13 at 09:33, Rob Dixon wrote:
> "Bob Showalter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> > Christiane Nerz wrote:
> > > Kevin Old wrote:
> > > ...
> > > > select undef, undef, undef, 0.25 or print $_
> > > > for 1 .. 5;
> > > ...
> > > quite interesting chunk
Kevin Old wrote:
>
> On Thu, 2003-11-13 at 09:33, Rob Dixon wrote:
> > "Bob Showalter" <[EMAIL PROTECTED]> wrote in message
> > >
> > > Christiane Nerz wrote:
> > > > Kevin Old wrote:
> > > > ...
> > > > > select undef, undef, undef, 0.25 or print $_
> > > > > for 1 .. 5;
> > > > ...
> > > > quit
Rob Dixon wrote:
>
> Not exactly a transparent piece of code though is it. Especially
> if your base system isn't Unix!
Works jusat fine on Windows, although it helps to have a longer list, since this gets
p[rocessed really fast, too fast to
see what's going on. Try increasing the loop count to
R. Joseph Newton wrote:
>
> Rob Dixon wrote:
>
> >
> > Not exactly a transparent piece of code though is it. Especially
> > if your base system isn't Unix!
>
> Works jusat fine on Windows, although it helps to have a longer list, since this
> gets p[rocessed really fast, too fast to
> see what's g
Joseph wrote:
>
> Rob Dixon wrote:
> >
> > Not exactly a transparent piece of code though is it. Especially
> > if your base system isn't Unix!
>
> Works jusat fine on Windows, although it helps to have a longer list,
> since this gets p[rocessed really fast, too fast to see what's going
> on. Try
Please choose a subject that is reflective of your post and start a new
thread when appropriate...
>
> I have a list of email addresses in a text file one to a line. How
would I
> seach for a particular email address?
>
> $email = "[EMAIL PROTECTED]";
>
The @ in the above does need to be esca
33 matches
Mail list logo