[22817] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5038 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 25 21:05:34 2003

Date: Sun, 25 May 2003 18:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 25 May 2003     Volume: 10 Number: 5038

Today's topics:
    Re: From a script to another one <jurgenex@hotmail.com>
        Getting position of a second match ($1 / index  kinda t (Stephen Adam)
    Re: Getting position of a second match ($1 / index  kin <see_signature.usenet@tinita.de>
    Re: Getting position of a second match ($1 / index  kin <see_signature.usenet@tinita.de>
    Re: Getting position of a second match ($1 / index  kin <krahnj@acm.org>
    Re: Help with errors. <mail@annuna.com>
    Re: Help with errors. <bwalton@rochester.rr.com>
    Re: Help with my game (Jay Tilton)
        need explanation <johnsmith@yahoo.com>
    Re: need explanation <webdataconsultants@yahoo.com>
    Re: need explanation <johnsmith@yahoo.com>
    Re: Net::AIM help! (Steven Danna)
    Re: parsing text <willis_31_40@yahoo.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 26 May 2003 00:30:54 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: From a script to another one
Message-Id: <2fdAa.9585$8i4.4176@nwrddc02.gnilink.net>

invalid@no.address wrote:
> Inside script1.pl, I need to call script2.pl, with passing parameters.

qx, system, and backticks come to mind.

> Then I need to look at the result of the call, staying in script1.pl

Please define result:
- do you mean the return value or script2
- do you mean the output of script2
- do you mean something totally different

> the call to script2.pl COULD be done by something like
> http://domain/path/script2.pl?param1=1&param2=2

??? That is a URI, not a call to a script

jue




------------------------------

Date: 25 May 2003 15:22:55 -0700
From: 00056312@brookes.ac.uk (Stephen Adam)
Subject: Getting position of a second match ($1 / index  kinda thing)
Message-Id: <945bf980.0305251422.52a3bdec@posting.google.com>

Hi peeps, 

I would like to know how to get the position of a second match in a
string.
 
The code below finds the position of the first "pow" in the string,
how can I get the position of the second pow?


PS - If you could comment your answers as I am still a bit muddled
about regex's and default vars - thanx.

Thanks in advance. 

Steve 


#!C:\perl\perl.exe

use strict;
use warnings; 
                                *** = 18                       *** = ?
my $string = "somerandomstuffandpowwecarronewithsomerandomstuffpowandabitmore";
my $regex;
my $position; 

$regex = "(pow)";                                 
$string =~/$regex/;   

$position = index($string, $1);
print "position is $position"; 
     
exit(0);


------------------------------

Date: 25 May 2003 22:44:09 GMT
From: Tina Mueller <see_signature.usenet@tinita.de>
Subject: Re: Getting position of a second match ($1 / index  kinda thing)
Message-Id: <bargvp$2tc5l$1@ID-24002.news.dfncis.de>

Stephen Adam wrote:

> I would like to know how to get the position of a second match in a
> string.
>  
> The code below finds the position of the first "pow" in the string,
> how can I get the position of the second pow?

if it's really a string and not a regex you can do:
my $num = 2; # second match
my $pos = -1;
for (1..$num) {
  $pos = index($string,"pow",$pos+1);
}

perldoc -f index

hth, tina
-- 
http://www.tinita.de/     \  enter__| |__the___ _ _ ___
     -- NOTE --            \     / _` / _ \/ _ \ '_(_-< of
I'm moving my domain, so    \    \ _,_\ __/\ __/_| /__/ perception
at the moment you can reach me at: tina {at} perlquotes . de


------------------------------

Date: 25 May 2003 23:20:27 GMT
From: Tina Mueller <see_signature.usenet@tinita.de>
Subject: Re: Getting position of a second match ($1 / index  kinda thing)
Message-Id: <barj3r$2tc5l$2@ID-24002.news.dfncis.de>

Tina Mueller wrote:

> if it's really a string and not a regex you can do:

or if it's a regex:
my $num = 2;
my $pos = -1;
for (1..$num) {
  $pos = $-[0] if $string =~ m/$regex/cg;
}

hth, tina
-- 
http://www.tinita.de/     \  enter__| |__the___ _ _ ___
     -- NOTE --            \     / _` / _ \/ _ \ '_(_-< of
I'm moving my domain, so    \    \ _,_\ __/\ __/_| /__/ perception
at the moment you can reach me at: tina {at} perlquotes . de


------------------------------

Date: Sun, 25 May 2003 23:50:19 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Getting position of a second match ($1 / index  kinda thing)
Message-Id: <3ED1569F.523EB51B@acm.org>

Stephen Adam wrote:
> 
> I would like to know how to get the position of a second match in a
> string.
> 
> The code below finds the position of the first "pow" in the string,
> how can I get the position of the second pow?
> 
> PS - If you could comment your answers as I am still a bit muddled
> about regex's and default vars - thanx.
> 
> #!C:\perl\perl.exe
> 
> use strict;
> use warnings;
>                                 *** = 18                       *** = ?
> my $string = "somerandomstuffandpowwecarronewithsomerandomstuffpowandabitmore";
> my $regex;
> my $position;
> 
> $regex = "(pow)";
> $string =~/$regex/;
> 
> $position = index($string, $1);
> print "position is $position";
> 
> exit(0);

$ perl -le'
my $string =
"somerandomstuffandpowwecarronewithsomerandomstuffpowandabitmore";
my $regex = qr/pow/;
print $-[0] while $string =~ /$regex/g;
'
18
49


John
-- 
use Perl;
program
fulfillment


------------------------------

Date: Sun, 25 May 2003 17:29:45 -0500
From: Joe Creaney <mail@annuna.com>
Subject: Re: Help with errors.
Message-Id: <3ED143D9.1030906@annuna.com>



Nicholas Dronen wrote:
> Joe Creaney <mail@annuna.com> wrote:
> JC> I have been working on my role playing game and I am getting errors I 
> JC> can't explain.  My two that are really stumping me are first why some 
> JC> values won't print in certain packages the other why it won't perform an 
> JC> if then operation.  The first error I wrote a function to generate.  The 
> JC> is I have an array and I want to check for the first open space defined 
> JC> by a space " " or the space being undef.  If so I want to something 
> JC> there.  The first time I use the block it works but if I come back to it 
> JC> it doesn't.  I have use all the debugging tricks I know and I can find 
> JC> no reason why I am getting these errors.  The program is long nearly 
> JC> 1,000 lines.
> 
> Why don't you post a *small* program that reproduces each problem?
> 
> JC> I am beginning to believe there is a problem with the compiler.
> 
> I doubt it.  
> 
I have a program that produces one of the errors at my site
www.annuna.com/perl5  file simple rpg 1.2 error.




------------------------------

Date: Sun, 25 May 2003 23:59:40 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Help with errors.
Message-Id: <3ED15863.7080606@rochester.rr.com>

Joe Creaney wrote:

> I have been working on my role playing game and I am getting errors I 
> can't explain.  My two that are really stumping me are first why some 
> values won't print in certain packages the other why it won't perform an 
> if then operation.  The first error I wrote a function to generate.  The 
> is I have an array and I want to check for the first open space defined 
> by a space " " or the space being undef.  If so I want to something 
> there.  The first time I use the block it works but if I come back to it 
> it doesn't.  I have use all the debugging tricks I know and I can find 
> no reason why I am getting these errors.  The program is long nearly 
> 1,000 lines.  I am beginning to believe there is a problem with the 
> compiler.
> 
> The game is at my site www.annuna.com/perl5 and it is under simple RPG 
> 1.2 error.
> 
> If I can't figure out why the program doesn't work I will have to drop 
> it and focus on learning C++.  Once I get proficient enough I will try 
> to write this game in another language.
> 

Just a suggestion:  Have you considered using Perl's built-in debugger? 
    It is started up like:

    perl -d script_name.pl

You can easily set a breakpoint to a line or the name of a sub and trace 
through statement by statement to see exactly what is happening, 
printing the values of variables as you go.  The "x" debugger command is 
particularly good at divulging the contents of complex objects like you 
have.  Answers to questions like those you are asking above become 
obvious.  For example, using the debugger for about 30 seconds:

I note that in your sub error, $play->{bag}->[0] has three elements 
(sometimes -- sometimes, apparently randomly, [0] has two elements and 
[1] has two elements rather than one element, in which case it is 
[1]->[0] which has the blank name), the first of which contains a hash 
with a name consisting of a single space character and undefs for 
several other hash keys.  That first array element is the source of the 
blank remainder of the line after the line starting with 0.  It appears 
the source of that entry is line 377:

    	killitem ($play);

sub killitem sets the name to a single blank character.

In regard to your question about variables not printing in certain 
packages:  user-defined named Perl variables are by default "package 
globals" and are not available outside their package unless exported or 
referred to by their full name (package::variable_name).  If you:

    use strict;

and

    use warnings;

you will be told about attempts to use variables which don't exist, 
along with many many other things.  Let Perl help you by *always* using 
strict and warnings.  Maybe

    use diagnostics;

too, if you're new to Perl.  This is particularly true for longer and 
more complicated programs like yours.  Note that you were not using 
warnings because the shebang line in your program wasn't the first line 
of the program, and hence was just an ordinary comment.  Also note that 
your program has *many many* places where strict fails and warnings 
gives warnings.  Clean those up and see if in the process lots of 
problems don't go away.

There are no known Perl compiler/interpreter problems which would 
generate symptoms such as you describe.  I can assure you that the 
problems are something in your code, and that if you write similar code 
in other languages, you will still have similar problems.  I doubt that 
anyone in the newsgroup will devote the time and energy needed to debug 
your code for you.  But we will help if you get stuck on problems you 
can show in complete programs which anyone can copy/paste/execute 
without making up data, typing in game commands, etc, which illustrate 
the problem and are short and to the point, like no more than 20 lines.

Good luck.
-- 
Bob Walton



------------------------------

Date: Sun, 25 May 2003 22:05:41 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Help with my game
Message-Id: <3ed13cd2.454544867@news.erols.com>

Joe Creaney <mail@annuna.com> wrote:
: Jay Tilton wrote:
: > Joe Creaney <mail@annuna.com> wrote:
: > 
: > : It is rpg 1.2 beta.  My problem is that I put weapons and armor which 
: > : are objects in a another object player and when I try to print them out 
: > : they don't show up.  
: > 
: > : The equipment that starts with the player will 
: > : print out.  I am really stumped.  The program is pretty long about 700 
: > : lines long.  I  hope on you gurus out there can explain to me what the 
: > : problem is and if I can fix it.
: > 
: > It would be nice if the program had a throwaway section of code that
: > automatically simulated the problem, e.g.
: 
: I did that and the error will show up after you choose a name for the 
: player.

Nicely done.

It looks like the name is being obliterated by the line
    $istore[$l]->{name} = " ";
int the killitem() sub.

It's not clear what that sub is supposed to be doing, or what the
@istore array is all about.  The program is in desperate need of some
commenting.  900 lines of code is a bit much to be existing without
any explanation of what's going on and why, especially if it's going
to use dense data structures.  Make that a priority.

The other priority should be to decide whether those data structures
are objects or not.  Right now it's on the fence, with object contents
being accessed directly and method calls being disguised as ordinary
subroutine calls.  Studying up on OO philosophy in general and Perl's
implementation of it will help greatly.

Not criticizing the effort.  Just noting where future effort would
best be focused.



------------------------------

Date: Mon, 26 May 2003 00:10:22 GMT
From: "Anthony" <johnsmith@yahoo.com>
Subject: need explanation
Message-Id: <3ed15b5b$1@news.syd.ip.net.au>

This is a multi-part message in MIME format.

------=_NextPart_000_001C_01C3236E.FDC61DE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Pls help me

trying to work out this script, and what it means!!!!!!! Can someone =
explain  what is highlighted in purple for me. Am finding it hard to =
know what it means.
Sstill trying to work perl out....
Any help would be appreciated


 my $num =3D 1;
 my $filename =3D "ABCDEFF.TXT";
 my $time =3D time();
 my ($min, $hour, $day, $mon, $year) =3D (localtime($time))[1..5]; =
$mon++; $year+=3D1900;   =20
 $num =3D $num<10?"0$num":$num;                                          =
                                                =20
 $min =3D $min<10?"0$min":$min;
 my $h2 =3D $hour%10;
 my $h1 =3D ($hour - $hour%10)/10;
 $day =3D $day<10?"0$day":$day;
 $mon =3D $mon<10?"0$mon":$mon;
 $year =3D $year%1000;

my $stamp =3D "${num}${day}${mon}${year}${h1}.${h2}${min}";

rename($filename, $stamp) or die("RENAME: $!");


------=_NextPart_000_001C_01C3236E.FDC61DE0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2719.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Pls help me</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>trying to work out this script, and =
what it=20
means!!!!!!! Can someone explain&nbsp; what is highlighted in purple for =
me. Am=20
finding it hard to know what it means.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Sstill trying to work perl =
out....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Any help would be =
appreciated</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;my $num =3D 1;<BR>&nbsp;my =
$filename =3D=20
"ABCDEFF.TXT";<BR>&nbsp;my $time =3D =
time();<BR><STRONG>&nbsp;</STRONG><FONT=20
color=3D#800080><STRONG>my ($min, $hour, $day, $mon, $year) =3D=20
(localtime($time))[1..5]; $mon++;=20
$year+=3D1900;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;$num =3D=20
$num&lt;10?"0$num":$num;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;$min=
=20
=3D $min&lt;10?"0$min":$min;<BR>&nbsp;my $h2 =3D $hour%10;<BR>&nbsp;my =
$h1 =3D ($hour=20
- $hour%10)/10;<BR>&nbsp;$day =3D $day&lt;10?"0$day":$day;<BR>&nbsp;$mon =
=3D=20
$mon&lt;10?"0$mon":$mon;<BR>&nbsp;$year =3D $year%1000;<BR><BR>my $stamp =
=3D=20
"${num}${day}${mon}${year}${h1}.${h2}${min}";</STRONG></FONT></FONT></DIV=
>
<DIV><FONT face=3DArial color=3D#ffff00 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>rename($filename, $stamp) or =
die("RENAME:=20
$!");<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_001C_01C3236E.FDC61DE0--



------------------------------

Date: Mon, 26 May 2003 00:28:12 GMT
From: "Erick Jones" <webdataconsultants@yahoo.com>
Subject: Re: need explanation
Message-Id: <wcdAa.972596$3D1.573013@sccrnsc01>

This is a multi-part message in MIME format.

------=_NextPart_000_0058_01C322FB.6E1C7400
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

It takes the 24 hour server time and converts it to standard 12 hour =
(am/pm) time
  "Anthony" <johnsmith@yahoo.com> wrote in message =
news:3ed15b5b$1@news.syd.ip.net.au...
  Pls help me

  trying to work out this script, and what it means!!!!!!! Can someone =
explain  what is highlighted in purple for me. Am finding it hard to =
know what it means.
  Sstill trying to work perl out....
  Any help would be appreciated


   my $num =3D 1;
   my $filename =3D "ABCDEFF.TXT";
   my $time =3D time();
   my ($min, $hour, $day, $mon, $year) =3D (localtime($time))[1..5]; =
$mon++; $year+=3D1900;   =20
   $num =3D $num<10?"0$num":$num;                                        =
                                                  =20
   $min =3D $min<10?"0$min":$min;
   my $h2 =3D $hour%10;
   my $h1 =3D ($hour - $hour%10)/10;
   $day =3D $day<10?"0$day":$day;
   $mon =3D $mon<10?"0$mon":$mon;
   $year =3D $year%1000;

  my $stamp =3D "${num}${day}${mon}${year}${h1}.${h2}${min}";

  rename($filename, $stamp) or die("RENAME: $!");

------=_NextPart_000_0058_01C322FB.6E1C7400
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>It takes the 24 hour&nbsp;server time =
and converts=20
it to standard 12 hour (am/pm) time</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV>"Anthony" &lt;<A=20
  href=3D"mailto:johnsmith@yahoo.com">johnsmith@yahoo.com</A>&gt; wrote =
in message=20
  <A=20
  =
href=3D"news:3ed15b5b$1@news.syd.ip.net.au">news:3ed15b5b$1@news.syd.ip.n=
et.au</A>...</DIV>
  <DIV><FONT face=3DArial size=3D2>Pls help me</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>trying to work out this script, and =
what it=20
  means!!!!!!! Can someone explain&nbsp; what is highlighted in purple =
for me.=20
  Am finding it hard to know what it means.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Sstill trying to work perl =
out....</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Any help would be =
appreciated</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;my $num =3D 1;<BR>&nbsp;my =
$filename =3D=20
  "ABCDEFF.TXT";<BR>&nbsp;my $time =3D =
time();<BR><STRONG>&nbsp;</STRONG><FONT=20
  color=3D#800080><STRONG>my ($min, $hour, $day, $mon, $year) =3D=20
  (localtime($time))[1..5]; $mon++;=20
  $year+=3D1900;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;$num =3D=20
  =
$num&lt;10?"0$num":$num;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;$min=
=20
  =3D $min&lt;10?"0$min":$min;<BR>&nbsp;my $h2 =3D $hour%10;<BR>&nbsp;my =
$h1 =3D=20
  ($hour - $hour%10)/10;<BR>&nbsp;$day =3D =
$day&lt;10?"0$day":$day;<BR>&nbsp;$mon=20
  =3D $mon&lt;10?"0$mon":$mon;<BR>&nbsp;$year =3D $year%1000;<BR><BR>my =
$stamp =3D=20
  =
"${num}${day}${mon}${year}${h1}.${h2}${min}";</STRONG></FONT></FONT></DIV=
>
  <DIV><FONT face=3DArial color=3D#ffff00 size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>rename($filename, $stamp) or =
die("RENAME:=20
  $!");<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0058_01C322FB.6E1C7400--



------------------------------

Date: Mon, 26 May 2003 00:58:41 GMT
From: "Anthony" <johnsmith@yahoo.com>
Subject: Re: need explanation
Message-Id: <3ed166b0@news.syd.ip.net.au>

This is a multi-part message in MIME format.

------=_NextPart_000_0009_01C32375.BE82E120
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

thanks for that,,,, what do the individual lines in purple mean????

thanks again
  "Erick Jones" <webdataconsultants@yahoo.com> wrote in message =
news:wcdAa.972596$3D1.573013@sccrnsc01...
  It takes the 24 hour server time and converts it to standard 12 hour =
(am/pm) time
    "Anthony" <johnsmith@yahoo.com> wrote in message =
news:3ed15b5b$1@news.syd.ip.net.au...
    Pls help me

    trying to work out this script, and what it means!!!!!!! Can someone =
explain  what is highlighted in purple for me. Am finding it hard to =
know what it means.
    Sstill trying to work perl out....
    Any help would be appreciated


     my $num =3D 1;
     my $filename =3D "ABCDEFF.TXT";
     my $time =3D time();
     my ($min, $hour, $day, $mon, $year) =3D (localtime($time))[1..5]; =
$mon++; $year+=3D1900;   =20
     $num =3D $num<10?"0$num":$num;                                      =
                                                    =20
     $min =3D $min<10?"0$min":$min;
     my $h2 =3D $hour%10;
     my $h1 =3D ($hour - $hour%10)/10;
     $day =3D $day<10?"0$day":$day;
     $mon =3D $mon<10?"0$mon":$mon;
     $year =3D $year%1000;

    my $stamp =3D "${num}${day}${mon}${year}${h1}.${h2}${min}";

    rename($filename, $stamp) or die("RENAME: $!");


------=_NextPart_000_0009_01C32375.BE82E120
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2719.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>thanks for that,,,, what do the =
individual lines in=20
purple mean????</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks again</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV>"Erick Jones" &lt;<A=20
  =
href=3D"mailto:webdataconsultants@yahoo.com">webdataconsultants@yahoo.com=
</A>&gt;=20
  wrote in message <A=20
  =
href=3D"news:wcdAa.972596$3D1.573013@sccrnsc01">news:wcdAa.972596$3D1.573=
013@sccrnsc01</A>...</DIV>
  <DIV><FONT face=3DArial size=3D2>It takes the 24 hour&nbsp;server time =
and=20
  converts it to standard 12 hour (am/pm) time</FONT></DIV>
  <BLOCKQUOTE dir=3Dltr=20
  style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    <DIV>"Anthony" &lt;<A=20
    href=3D"mailto:johnsmith@yahoo.com">johnsmith@yahoo.com</A>&gt; =
wrote in=20
    message <A=20
    =
href=3D"news:3ed15b5b$1@news.syd.ip.net.au">news:3ed15b5b$1@news.syd.ip.n=
et.au</A>...</DIV>
    <DIV><FONT face=3DArial size=3D2>Pls help me</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>trying to work out this script, and =
what it=20
    means!!!!!!! Can someone explain&nbsp; what is highlighted in purple =
for me.=20
    Am finding it hard to know what it means.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>Sstill trying to work perl =
out....</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>Any help would be =
appreciated</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
    size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>&nbsp;my $num =3D 1;<BR>&nbsp;my =
$filename =3D=20
    "ABCDEFF.TXT";<BR>&nbsp;my $time =3D =
time();<BR><STRONG>&nbsp;</STRONG><FONT=20
    color=3D#800080><STRONG>my ($min, $hour, $day, $mon, $year) =3D=20
    (localtime($time))[1..5]; $mon++;=20
    $year+=3D1900;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;$num =3D=20
    =
$num&lt;10?"0$num":$num;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;$min=
=20
    =3D $min&lt;10?"0$min":$min;<BR>&nbsp;my $h2 =3D =
$hour%10;<BR>&nbsp;my $h1 =3D=20
    ($hour - $hour%10)/10;<BR>&nbsp;$day =3D=20
    $day&lt;10?"0$day":$day;<BR>&nbsp;$mon =3D=20
    $mon&lt;10?"0$mon":$mon;<BR>&nbsp;$year =3D $year%1000;<BR><BR>my =
$stamp =3D=20
    =
"${num}${day}${mon}${year}${h1}.${h2}${min}";</STRONG></FONT></FONT></DIV=
>
    <DIV><FONT face=3DArial color=3D#ffff00 size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>rename($filename, $stamp) or =
die("RENAME:=20
    $!");<BR></FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0009_01C32375.BE82E120--



------------------------------

Date: 25 May 2003 17:40:52 -0700
From: MissingWords@hotmail.com (Steven Danna)
Subject: Re: Net::AIM help!
Message-Id: <e78d8c5a.0305251640.39f8d0df@posting.google.com>

"Richard Mahoney" <rm.mymail@NOSPAMHEREntlworld.com> wrote in message news:<Re6za.10403$Mu3.200136@newsfep4-glfd.server.ntli.net>...
> Hi!
> 
> I'm having trouble sending an instant message with the Perl module Net::AIM.
> 
> I can connect to the service but it will not send a message???
> 
>  ===============
>   use Net::AIM;
> 
>   $aim = new Net::AIM;
>   $conn = $aim->newconn(Screenname   => 'AIMScreenname',
>                         Password     => 'Password');
>   $aim->start; // Connects fine
> 
>   $aim->send_im('AnotherScreenname', 'Message'); // Doesn't work??
> 
> ===============
> 
> Can anyone tell me what I'm doing wrong?
> 
> Many thanks, it's appreciated.
> Rich.

   After doing a little digging around I found that there is a method
that doesn't seem to be presented in Net::AIM documentation(at least
in v1.22). This is the $aim->set_handler() method. I have found a test
script which seems to work very well.  This script can be found here:

http://www.aryeh.net/Net-AIM/aimtest

  I have used this script and it seems to work well; however, I am
still trying to dig through it to figure out exactly what is needed to
just send a message.  From what I can see so far the set_handler
method assigns certain subroutines to execute when certain signals are
gotton for instance:


sub on_config {
   my ($self, $evt, $from, $to) = @_;
	
   my $str = shift @{$evt->args()};
   $self->set_config_str($str, 1);

#   $self->send_buddies;
   $self->send_config();
}

$conn->set_handler('config',    \&on_config);

  the 'config' handler seems to be inportant(it may be that the AOL
server sends this "signal"(if it can really be called that) shortly
after a connection is made).  Unfortunatly, when i tried to implement
a script like yours with the addition of the 'config' handler it still
failed to do anything.

I hope some of this can help you in your search.  I wanted to get a
working example before I posted but I have a feeling that someone else
may be able to figure it out long before I do.

Please fill me in if you ever get it working.
Steven Danna


------------------------------

Date: Mon, 26 May 2003 00:55:20 GMT
From: w i l l <willis_31_40@yahoo.com>
Subject: Re: parsing text
Message-Id: <m9p2dvskqbcasdtikhcoqc3u53m0i0o0gd@4ax.com>

On Sun, 25 May 2003 22:36:28 +0100, "Brian H¹©" <no.spam@this.addy.ta>
wrote:

>Following on from my counter query the other day.
>I have created some more scripts that treat the list in various ways and give me
>a final list containing just one word.
>e.g. a text file "blahblah.txt" containing just the word "fred".
>I would like to be able to parse/echo the word "fred" to a DOS edit command.
>Can I call upon someone again to come to my rescue please?
>I know that this may not require a perl script, and may only require a couple of
>DOS commands, but the help section of my DOS book is about as useless as boobs
>on a stallion.
>
>TIA (again)
>
>Brian
>


I'm not clear on what you are trying to do, but hopefully these hint
will get you where you want to go.

1) opening and reading a file (assuming the word "fred" is on the
first line of the .txt file)

open(FILE,"<blah.txt") || die $!;
my $firstLine = <FILE>;
# so $firstLine contains the value
# "fred\n"

2) using perl on Windows to call DOS commands

system('copy file1 file2');
#this would do a copy command

system('echo this');
#displays "this" to the screen

system("echo $firstLine");
#prints fred\n to screen

w i l l


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 5038
***************************************


home help back first fref pref prev next nref lref last post