[28786] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 30 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 15 00:05:48 2007

Date: Sun, 14 Jan 2007 21:05:05 -0800 (PST)
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, 14 Jan 2007     Volume: 11 Number: 30

Today's topics:
    Re: Ascii characters in a loop <uri@stemsystems.com>
    Re: Ascii characters in a loop <john@castleamber.com>
    Re: backtick and system command mail4ashok@gmail.com
    Re: cgi problem with "gt" and "lt" <tadmc@augustmail.com>
    Re: cgi problem with "gt" and "lt" <joe@inwap.com>
        Evaluation context of C-style Logical And/Or truexueweizhong@hotmail.com
    Re: Evaluation context of C-style Logical And/Or truexueweizhong@hotmail.com
    Re: Evaluation context of C-style Logical And/Or axel@white-eagle.invalid.uk
    Re: Evaluation context of C-style Logical And/Or <someone@example.com>
    Re: Evaluation context of C-style Logical And/Or truexueweizhong@hotmail.com
    Re: Evaluation context of C-style Logical And/Or <someone@example.com>
    Re: Evaluation context of C-style Logical And/Or <someone@example.com>
        HTML/Perl/CGI Question.  Howto? <amerar@iwc.net>
    Re: HTML/Perl/CGI Question.  Howto? <spamtrap@dot-app.org>
    Re: HTML/Perl/CGI Question.  Howto? <tadmc@augustmail.com>
    Re: HTML/Perl/CGI Question. Howto? krakle@visto.com
    Re: Parsing some input - easy to explain but lengthy to <someone@example.com>
    Re: Perl free e-books <john@castleamber.com>
    Re: qr and subroutines <alt.testing@N0SP4M.gmail.com>
    Re: Unix commands <tadmc@augustmail.com>
    Re: Unix commands <john@castleamber.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 14 Jan 2007 23:23:29 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Ascii characters in a loop
Message-Id: <x7r6twrk8u.fsf@mail.sysarch.com>

>>>>> "MH" == Mark Hobley <markhobley@hotpop.deletethisbit.com> writes:

  MH> Uri Guttman <uri@stemsystems.com> wrote:
  >> what part of that do you find unclear?

  MH> I think that general navigation of this document is not
  MH> straightforward, and I think that where there are fundamental
  MH> issues that affect basic loops, they should be mentioned in the
  MH> loop section, and the document should provide examples.

well, what if you are wrong in your assumptions? magic increment is
independent of loops as it should be. there is nothing special about a
loop that makes your code special. it is the same as if you did a loop
from 1 to 10 but went to 11 because you had a classic off by one
error. this is a fault of the coder, not of the language. i have seen
many off by one errors and worse, coders who don't understand them or
how to fix them. teach that instead and not some well documented 'quirk'
about magic increment.

  MH> Yeah, that is quite possible. I tend to use generic code, that I
  MH> may reuse in other projects.

hammers aren't generic. you missed my metaphor. 

  MH> FYI my background is MSDOS assembly language, so I am having to
  MH> learn the Unix way of doing everything, which just sometimes seems
  MH> alien to me.

and you don't considier winblows alien? MUAHAHAHAHAH!

  MH> However, it will be nice when I have learnt everything.

good luck. i know it will take you at least three more weeks. i have
only been learning about computers for 33 years and i know nothing. that
is proven every day.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 15 Jan 2007 04:50:29 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Ascii characters in a loop
Message-Id: <Xns98B8E85B3D657castleamber@130.133.1.4>

Uri Guttman <uri@stemsystems.com> wrote:

> hammers aren't generic. you missed my metaphor. 

Famous last words :-)

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: 14 Jan 2007 16:20:00 -0800
From: mail4ashok@gmail.com
Subject: Re: backtick and system command
Message-Id: <1168820400.752063.259420@q2g2000cwa.googlegroups.com>

replyin to  my own post  - did not intent to break any rules

this seem to work; may not be efficient and maybe longwinded

system "{ command  ; echo $? >/tmp/rc; } | tee /tmp/t";

thanks everyone



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

Date: Sun, 14 Jan 2007 20:04:44 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: cgi problem with "gt" and "lt"
Message-Id: <slrneqlo9s.3pj.tadmc@tadmc30.august.net>

Nick Wedd <nick@maproom.co.uk> wrote:

> Here is the piece of my code that causes a problem:
>
>   foreach $cc ( param() ) {
>     $col = param($cc);


What problem does it cause you?


> and here is a piece of my cgi argument list:
>
>  gl=6&gt=6&hn=6&mx=6&ni=8
>
> It all works 


What does "works" mean when you say it?

That is, what did you intend it to do?


> except for when $cc (the key) is "gt" or "lt".  I can guess
> what is going on, but I have no idea what I should do about it.  Can
> someone please advise?


I advise that you tell us what you wanted it to do, and what it
is doing that is different from what you wanted it to do.

WAG:
I sure hope you don't have an "eval EXPR" in your code that you
haven't shown us...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 14 Jan 2007 18:14:59 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: cgi problem with "gt" and "lt"
Message-Id: <lZidnWghLpg4fjfYnZ2dnUVZ_t-mnZ2d@comcast.com>

Nick Wedd wrote:
> Here is the piece of my code that causes a problem:
> 
>   foreach $cc ( param() ) {
>     $col = param($cc);
> 
> and here is a piece of my cgi argument list:
> 
>  gl=6&gt=6&hn=6&mx=6&ni=8
> 
> It all works except for when $cc (the key) is "gt" or "lt". 

Try using ";" instead of "&" in the CGI argument list.

   gl=6;gt=6;hn=6;mx=6;ni=8

http://www.w3.org/TR/html401/appendix/notes.html#ampersands-in-uris


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

Date: 14 Jan 2007 17:45:55 -0800
From: truexueweizhong@hotmail.com
Subject: Evaluation context of C-style Logical And/Or
Message-Id: <1168825555.398715.187340@q2g2000cwa.googlegroups.com>

I'm really confused about the following result:

$ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a || @b; print @c'
2
-----------seemed to be scalar context

$ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a or @b; print @c'
a1a2
----------seemed to be list context

what's the rules govering this issue?
the sentence in perlop say it not clearly, only one sentence:

       Scalar or list context propagates down to the right operand if
it is  evaluated.
and

       Logical or and Exclusive Or

       Binary "or" returns the logical disjunction of the two
surrounding
       expressions.  It's equivalent to || except for the very low
precedence.


But what's the explaination of sampling code?



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

Date: 14 Jan 2007 18:53:55 -0800
From: truexueweizhong@hotmail.com
Subject: Re: Evaluation context of C-style Logical And/Or
Message-Id: <1168829635.584206.238270@a75g2000cwd.googlegroups.com>

> $ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a or @b; print @c'
> a1a2

Now i know this one, because
             @c = @a or @b
is equal to
             (@c = @a) or @b
so it's not amazing any more.

But I'm still confused about the following result:

$ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a && @b; print @c'
b1b2
                          ------------- && , list context
$ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a || @b; print @c'
2
                          ------------- ||, scalar context



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

Date: Mon, 15 Jan 2007 03:07:55 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: Evaluation context of C-style Logical And/Or
Message-Id: <feCqh.17761$uA2.3609@newsfe07.phx>

truexueweizhong@hotmail.com wrote:
> I'm really confused about the following result:
 
> $ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a || @b; print @c'
> 2
> -----------seemed to be scalar context
> 
> $ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a or @b; print @c'
> a1a2
> ----------seemed to be list context
 
> But what's the explaination of sampling code?

An array in scalar context returns the number of elements

An array in scalar context returns the number of elements. So your first
example: 

	@c = @a || @b;
	
evaluates to:

	@c = 2 || 2;
	
making @c an array with the one element '2';
 
In the second example '=' has a higher precendence than the 'or' and so
the values of the array @a are copied to @c.

Axel



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

Date: Mon, 15 Jan 2007 03:08:48 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Evaluation context of C-style Logical And/Or
Message-Id: <4fCqh.154005$hn.115694@edtnps82>

truexueweizhong@hotmail.com wrote:
> I'm really confused about the following result:
> 
> $ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a || @b; print @c'
> 2
> -----------seemed to be scalar context
> 
> $ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a or @b; print @c'
> a1a2
> ----------seemed to be list context
> 
> what's the rules govering this issue?

Don't use '||' or 'or' with arrays or lists or hashes, only with scalars.

$ perl -wle '@a = ( "a1", "a2" ); @b = ( "b1", "b2" ); @c = @a || @b; @a = ();
@d = @a || @b; print for "@c", "@d"'
2
b1 b2
$ perl -wle '@a = ( "a1", "a2" ); @b = ( "b1", "b2" ); @c = @a or @b; @a = ();
@d = @a or @b; print for "@c", "@d"'
Useless use of a variable in void context at -e line 1.
Useless use of a variable in void context at -e line 1.
a1 a2



Note that:

@c = @a or @b;

and:

@c = @a;

do the same thing because of the low precedence of 'or' (see the warning
messages above.)

However the conditional operator does work with lists, arrays and hashes so
this will do what you want:

@c = @a ? @a : @b;


> the sentence in perlop say it not clearly, only one sentence:
> 
>        Scalar or list context propagates down to the right operand if
> it is  evaluated.
> and

@c = @a || @b;

'@c' is an array so there is list context to the right of '='.  '@a ||'
determines whether '@a' is "true" or "false".  In order to determine if '@a'
is "true" or "false" it must be evaluated in scalar context.  If it is "true"
the results of that evaluation is then assigned to '@c'.  If it is "false"
then the list context is propagated through to '@b'.



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


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

Date: 14 Jan 2007 19:19:28 -0800
From: truexueweizhong@hotmail.com
Subject: Re: Evaluation context of C-style Logical And/Or
Message-Id: <1168831168.807810.306100@a75g2000cwd.googlegroups.com>

>
> @c = @a || @b;
>
> '@c' is an array so there is list context to the right of '='.  '@a ||'
> determines whether '@a' is "true" or "false".  In order to determine if '@a'
> is "true" or "false" it must be evaluated in scalar context.  If it is "true"
> the results of that evaluation is then assigned to '@c'.  If it is "false"
> then the list context is propagated through to '@b'.
>

So what's the difference between
       @c = @a || @b
and
      @c = @a && @b

In the latter case,  the Perl evaluate @a in LIST context rather than
SCALAR, why?



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

Date: Mon, 15 Jan 2007 03:21:31 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Evaluation context of C-style Logical And/Or
Message-Id: <%qCqh.149504$YV4.116430@edtnps89>

axel@white-eagle.invalid.uk wrote:
> truexueweizhong@hotmail.com wrote:
>>I'm really confused about the following result:
>  
>>$ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a || @b; print @c'
>>2
>>-----------seemed to be scalar context
>>
>>$ perl -e '@a = (a1,a2); @b = (b1,b2); @c = @a or @b; print @c'
>>a1a2
>>----------seemed to be list context
>  
>>But what's the explaination of sampling code?
> 
> An array in scalar context returns the number of elements
> 
> An array in scalar context returns the number of elements. So your first
> example: 
> 
> 	@c = @a || @b;
> 	
> evaluates to:
> 
> 	@c = 2 || 2;

Actually it evaluates to:

 	@c = 2 || @b;




John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


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

Date: Mon, 15 Jan 2007 04:33:21 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Evaluation context of C-style Logical And/Or
Message-Id: <luDqh.154506$hn.135374@edtnps82>

truexueweizhong@hotmail.com wrote:
>>@c = @a || @b;
>>
>>'@c' is an array so there is list context to the right of '='.  '@a ||'
>>determines whether '@a' is "true" or "false".  In order to determine if '@a'
>>is "true" or "false" it must be evaluated in scalar context.  If it is "true"
>>the results of that evaluation is then assigned to '@c'.  If it is "false"
>>then the list context is propagated through to '@b'.
>>
> 
> So what's the difference between
>        @c = @a || @b
> and
>       @c = @a && @b
> 
> In the latter case,  the Perl evaluate @a in LIST context rather than
> SCALAR, why?

No, it evaluates @a in scalar context:

$ perl -wle '@a = ( "a1", "a2" ); @b = ( "b1", "b2" ); @c = @a && @b; @a = ();
@d = @a && @b; print for "@c", "@d"'
b1 b2
0


Otherwise it would print:

b1 b2
a1 a2

instead.




John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


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

Date: 14 Jan 2007 16:03:44 -0800
From: "amerar@iwc.net" <amerar@iwc.net>
Subject: HTML/Perl/CGI Question.  Howto?
Message-Id: <1168819423.991142.259370@51g2000cwl.googlegroups.com>


Hi All,

I have a simple Perl script that send email to me.

I need to write an HTML form that has a button which will browse the
users hard drive to allow them to send an attachment, along with the
email......

I have no clue how to start that.  Can anyone help?

Thanks!



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

Date: Sun, 14 Jan 2007 19:24:09 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: HTML/Perl/CGI Question.  Howto?
Message-Id: <m264b99lxy.fsf@Sherm-Pendleys-Computer.local>

"amerar@iwc.net" <amerar@iwc.net> writes:

> I have a simple Perl script that send email to me.
>
> I need to write an HTML form that has a button which will browse the
> users hard drive to allow them to send an attachment, along with the
> email......
>
> I have no clue how to start that.  Can anyone help?

You'd write it the same way you would if your script were written in some-
thing other than Perl. HTML is off-topic here - try asking your question
in an HTML group such as comp.infosystems.www.authoring.html.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Sun, 14 Jan 2007 20:46:28 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: HTML/Perl/CGI Question.  Howto?
Message-Id: <slrneqlqo4.41a.tadmc@tadmc30.august.net>

amerar@iwc.net <amerar@iwc.net> wrote:

> I need to write an HTML form


Then you should ask in a newsgroup about HTML.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 14 Jan 2007 17:11:47 -0800
From: krakle@visto.com
Subject: Re: HTML/Perl/CGI Question. Howto?
Message-Id: <1168823507.507143.127040@51g2000cwl.googlegroups.com>



On Jan 14, 6:24 pm, Sherm Pendley <spamt...@dot-app.org> wrote:
> "ame...@iwc.net" <ame...@iwc.net> writes:
> > I have a simple Perl script that send email to me.
>
> > I need to write an HTML form that has a button which will browse the
> > users hard drive to allow them to send an attachment, along with the
> > email......
>
> > I have no clue how to start that.  Can anyone help?You'd write it the same way you would if your script were written in some-
> thing other than Perl. HTML is off-topic here - try asking your question
> in an HTML group such as comp.infosystems.www.authoring.html.

Maybe Sherm is too dumb to realise what the original poster was asking.
He wants to know where to start on accepting file uploads. CGI.pm
handles file uploads quite nicely. Look at the CGI.pm documentation for
File Uploads. If you want to simplify the uploading look into one of
the many modules that will assist you. Check out CPAN.

As for the HTML coding (which is offtopic here as genius Sherm pointed
out) you can easily find more info on the subject by typing in "HTML
File Upload" in Google.

Was that too difficult for you Sherm?



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

Date: Mon, 15 Jan 2007 00:13:07 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Parsing some input - easy to explain but lengthy to code - suggestions?
Message-Id: <nGzqh.138758$rv4.76505@edtnps90>

doolittle wrote:
> 
> I have to check that some input conforms to some rules. Although the
> rules are simple to expain, my perl function looks too complex/long,
> can it be done more simply?
> 
> The rule is that the first character must be a letter, and the second
> and third characters must form a number between 1 and 25 (so the third
> character is optional)
> 
> sub isOK {
>   my $str = shift;
> 
>   # get the first character
>   my $chr = lc substr $str, 0, 1;
> 
>   # return false if the first character is not a letter between a and Z
>   return 0 if $chr !~ /[a-z]/o;
> 
>   # get the second character
>   $chr = substr $str, 1, 1;
> 
>   # return false if the second character is not
>   # a number between 1 and 9
>   return 0 if $chr !~ /[1-9]/o;
> 
>   # get the third character
>   $chr = substr $str, 2, 1;
> 
>   if ($chr) {
>     # return false if the third character exists, but is not a number
>     return 0 if $chr !~ /\d/o;
> 
>     # return false if the combination of the 2nd and
>     # 3rd characters is over 25
>     return 0 if (substr $str, 1) > 25;
>   }
> 
>   # otherwise return true
>   return 1
> }

sub isOK { $_[ 0 ] =~ /\A[a-zA-Z](?:[1-9]|1[0-9]|2[0-5])\z/ ? 1 : 0 }




John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


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

Date: 15 Jan 2007 04:46:05 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Perl free e-books
Message-Id: <Xns98B8E79BB2D4castleamber@130.133.1.4>

"John W. Kennedy" <jwkenne@attglobal.net> wrote:
 
> That was on January 11th. He stopped using HTML as of the 12th.

Yup, I wrote 
"Don't reply using HTML" to a post with HTML to which Joe replied "He's 
not posting using HTML." Shuo was in the message I replied to with that 
request (I think it was the 3rd time), but probably stopped after that. So 
I guess Joe was trying to sasy: "He's not posting using HTML any longer." 
No idea.

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: Mon, 15 Jan 2007 13:15:23 +1100
From: WRX <alt.testing@N0SP4M.gmail.com>
Subject: Re: qr and subroutines
Message-Id: <bcngq258h8b2rjmbnu5gmv5dfn3ku1uvgl@4ax.com>

On Fri, 12 Jan 2007 14:18:24 +0100, Robert 'phaylon' Sedlacek
<rs@474.at> wrote:

[SNIP]
>> } 
>
>Wait a second. First, don't use & in front of build_url unless you
>really know what it is doing. Second: Your $tmp_regex is not a regex,
>it's a string. Third: In your function you don't use $tmp_regex as
>regex, but as substitute.
>

OK, after reading up, I understand no "&" when calling function in
this way, thanks.
I shouldn't have referred to the string as "regex", but I was really
referring to the 3'rd example, which was "regex" and "string
replacement" all in one go. I agree, incorrect in definition.

[SNIP]



>The solutions:
>- Use a regex where you want a regex, use a string where you want a
>  string.
>- You can pass more than one argument.
>
>
><untested>
>
>  my $search  = qr/index\.php/;
>  my $replace = 'admin/index.php?admin=22&sid=';
>
>  my $new_uri
>    = rework_uri('http://example.com/index.php', $search, $replace);
>
>  sub rework_uri {
>    my ($uri, $search, $replace) = @_;
>    $uri =~ s/$search/$replace/;
>    $uri .= $sid;
>    return $uri;
>  }
>
></untested>

I agree, and I understand that I can do it this way, but it's STILL "3
lines of code", which is no less than what I had originally - so I
don't obtain an advantage of brevity in re-using code through a
subroutine. I just wanted to do something like that all in one
statement, that passes everything to the subroutine. 

Mind you,  there is an advantage in doing it that way - by passing
"regex" and "replacement" string, a degree of flexibility is obtained,
so that has to be considered a win. Thanks mate.


AND consequently, considering your advice, what about this:

my $input_url = 'http://xyz.com.au/forum/index.php';
my $tmp_regex = '';



   $tmp_regex = qr/index\.php/;
my $login_url = build_url( $tmp_regex, 'admin/index.php?sid=', 1 );



sub build_url {
 my ( $tmp_regex, $replace_string, $sid_flag ) = @_;
 my $tmp_url   =  $input_url;
    $tmp_url   =~ s/$tmp_regex/$replace_string/;
    $tmp_url   .= $s_id if ( $sid_flag == 1 );
 return $tmp_url;  
} 


So, I get the code in the body of the program down to two lines, each
time I need to perform the action, and further, gain the flexibility
of supplying the qr/regex/ AND the replacement string, and a flag to
add the $s_id or not  :-)

Does it get any better than this?





#!/usr/bin/perl

use strict;
use warnings;

use WWW::Mechanize;
my $mech = WWW::Mechanize->new( autocheck => 1 );

use WWW::Mechanize::Frames;
my $mech_f = WWW::Mechanize::Frames->new();

my $input_url = 'http://xyz.com.au/forum/index.php';
my $name = 'username';
my $password = 'password';
my $button = 'login';
my $tmp_regex = '';

$mech->get( $input_url );

print_title();
authenticate();

my $raw_mech = $mech->content;

my $s_id = $raw_mech;
   $s_id =~ tr/\n/ /;
   $s_id =~ s/^.*admin\/index\.php\?sid=([0-9a-z]*)">.*$/$1/;

   $tmp_regex = qr/index\.php/;
my $login_url = build_url( $tmp_regex, 'admin/index.php?sid=', 1 );

   $tmp_regex = qr/index\.php/;
my $logout_url = build_url( $tmp_regex, 'login.php?logout=true&sid=',
1 );

$mech->get( $login_url );

print_title();
authenticate();

   $tmp_regex = qr/index\.php/;
my $admin_url = build_url( $tmp_regex, 'admin/index.php?admin=1&sid=',
1 );

$mech_f->get( $admin_url );

print_title();

my @frames = $mech_f->get_frames();

$raw_mech = "";
$raw_mech = $mech->content;

print "$login_url\n";
print "$logout_url\n";
print "$admin_url\n";

#print $frames[0]->content;
#print $frames[1]->content;

logout();
exit 0;


#==================================================================#

sub authenticate {
 $mech->set_fields( $name => '' );
 $mech->set_fields( $password => '' );
 $mech->click;
}

sub print_title {
 my $raw_mech =  $mech->content;
 my $page_title = $raw_mech;
    $page_title =~ tr/\n/ /;
    $page_title =~ s|^.*<title>(.*)</title>.*$|$1|i;
    $page_title =~ s/^/PAGE TITLE: /;
 print "\n$page_title\n";  
}

sub build_url {
 my ( $tmp_regex, $replace_string, $sid_flag ) = @_;
 my $tmp_url   =  $input_url;
    $tmp_url   =~ s/$tmp_regex/$replace_string/;
    $tmp_url   .= $s_id if ( $sid_flag == 1 );
 return $tmp_url;  
} 

sub logout {
 $mech->get( $logout_url );
}


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

Date: Sun, 14 Jan 2007 20:01:02 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Unix commands
Message-Id: <slrneqlo2u.3pj.tadmc@tadmc30.august.net>

John Bokma <john@castleamber.com> wrote:
> Andrew DeFaria <Andrew@DeFaria.com> wrote:
>
>> Martijn Lievaart wrote:
>>> On Sat, 13 Jan 2007 13:10:33 -0600, Andrew DeFaria wrote:
>>>
>>>> Listen sonny, I've probably worked at far more companies than you,
>>> You're fired very frequently? I'm not surprised.
>> I've never been fired.
>
> Yup, people just started to ignore you and then you moved on.


We can only hope that history will repeat itself here.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 15 Jan 2007 04:42:38 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Unix commands
Message-Id: <Xns98B8E705E52F0castleamber@130.133.1.4>

Tad McClellan <tadmc@augustmail.com> wrote:

> John Bokma <john@castleamber.com> wrote:
>> Andrew DeFaria <Andrew@DeFaria.com> wrote:
>>
>>> Martijn Lievaart wrote:
>>>> On Sat, 13 Jan 2007 13:10:33 -0600, Andrew DeFaria wrote:
>>>>
>>>>> Listen sonny, I've probably worked at far more companies than you,
>>>> You're fired very frequently? I'm not surprised.
>>> I've never been fired.
>>
>> Yup, people just started to ignore you and then you moved on.
> 
> We can only hope that history will repeat itself here.

:-D

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 30
*************************************


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