[25365] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7610 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 5 21:05:32 2005

Date: Wed, 5 Jan 2005 18:05:19 -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           Wed, 5 Jan 2005     Volume: 10 Number: 7610

Today's topics:
    Re: 2-D graphical rendering/manipulation <postmaster@castleamber.com>
        =?ISO-8859-15?Q?Net::SSH::Perl=20-=20remoteinteract.pl= <news@chaos-net.de>
    Re: Can You Figure Out This - Looping <jkeen_via_google@yahoo.com>
    Re: Can You Figure Out This - Looping <newsTWOme@pacifierDOTcom>
    Re: Can You Figure Out This - Looping <jgibson@mail.arc.nasa.gov>
    Re: Dummy regex question <tadmc@augustmail.com>
    Re: Dummy regex question <1usa@llenroc.ude.invalid>
        Extra new line inserted in simple program <please_reply_to_newsgroup@something.com>
    Re: Extra new line inserted in simple program <please_reply_to_newsgroup@something.com>
    Re: Extra new line inserted in simple program <abigail@abigail.nl>
    Re: Extra new line inserted in simple program <uri@stemsystems.com>
    Re: Extra new line inserted in simple program <please_reply_to_newsgroup@something.com>
    Re: Extra new line inserted in simple program <matternc@comcast.net>
    Re: FAQ 4.30: How do I capitalize all the words on one  <tadmc@augustmail.com>
    Re: FAQ 4.30: How do I capitalize all the words on one  <jurgenex@hotmail.com>
    Re: Having Trouble with a CGI login script (www.1-script.com)
    Re: Having Trouble with a CGI login script <tadmc@augustmail.com>
    Re: Having Trouble with a CGI login script WhiteFungus@gmail.com
    Re: Having Trouble with a CGI login script WhiteFungus@gmail.com
        Is there  a web interface tool that can manage accounts (jiing)
    Re: Multiple lines of html store in variable non messy  <tadmc@augustmail.com>
    Re: Multiple lines of html store in variable non messy  <tadmc@augustmail.com>
    Re: Need help sorting fixed length records <jurgenex@hotmail.com>
    Re: Newbie question: "Get substring of line" <matthew.garrish@sympatico.ca>
        Read a password from keyboard... <ddupuis@nospam.org>
    Re: Read a password from keyboard... <spamtrap@dot-app.org>
    Re: Read a password from keyboard... <jurgenex@hotmail.com>
    Re: Searching perl script which calls web page and forw <tadmc@augustmail.com>
    Re: Searching perl script which calls web page and forw (www.1-script.com)
    Re: sort directory help <tadmc@augustmail.com>
    Re: specifying use strict <carlton_gregory@yahoo.com>
    Re: specifying use strict <spamtrap@dot-app.org>
    Re: specifying use strict <matthew.garrish@sympatico.ca>
    Re: specifying use strict <carlton_gregory@yahoo.com>
        What happened with this year's Perl Advent Calendar? <jimmonty@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 5 Jan 2005 23:10:52 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: 2-D graphical rendering/manipulation
Message-Id: <Xns95D5AEC659626castleamber@130.133.1.4>

h4ck4w wrote:

> I'm trying to do some basic graphical manipulation in Perl.  I am just
> going to use 2-D images in some standard format (GIF, JPG, PNG, etc.).
> Is there some simple module out there that can render, layer, move,
> rotate, and perhaps draw basic lines, shapes, etc?  I've been poking
> around on CPAN, and was looking at OpenGL.  This looks like it could do
> the job, but is definatley much more than I need.  Is there something
> simpiler out there?  Any and all input will be appreciated.  Thanks.

http://search.cpan.org/~jcristy/PerlMagick-6.17/Magick.pm ?

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Thu, 6 Jan 2005 01:15:04 +0000 (UTC)
From: <news@chaos-net.de>
Subject: =?ISO-8859-15?Q?Net::SSH::Perl=20-=20remoteinteract.pl=20doesn=3Ft=20work?=
Message-Id: <20050106021505638+0100@mail.gu.net>

There?s an examplescript on http://search.cpan.org/src/DROLSKY/Net-SSH-
Perl-1.25/eg/remoteinteract.pl

It?s not working with me although I have 
The "passwd" command gets send and the output of the Command on the 
remote Computer is recieved by the script (which I have proofed by 
adding additional debug-commands).
Then the script hangs.
This must be at theses lines of code:

--- snip ---
if ($str eq "(current) UNIX password: ") {
        my $packet = $ssh->packet_start(SSH_CMSG_STDIN_DATA);
        $packet->put_str($old_password);
        $packet->send;
--- snap ---

Has anyone run the "remoteinteract.pl" successfully ?


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

Date: Wed, 05 Jan 2005 23:20:39 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: Can You Figure Out This - Looping
Message-Id: <bD_Cd.39088$vF5.20123@trndny07>

Digger wrote:
> Ok...... I am new at perl, have been at it for a week or so now
> learning.........
> 
> I am trying to do the following....
> 
> I have a log (url.log) file that contains various url's  and some of
> them have errors (indicated with a "FAILURE" in the log file).... Now
> I want to extract these url's that have the "FAILURE". 
> 
> log file format
> 
> date : error message : url
> 
> 
> The problem is this file gets updated every 10 minutes, and in that
> time the url could become valid.......
> 
> example:
> 
> 2004-12-24 FAILURE www.bla.com
> 2004-12-24 SUCCESS www.bla.com
> .........
> 
> So from the above example the url is valid and I would like a 0 sent
> to a file........
> 
> 2004-12-24 FAILURE www.bla.com
> 2004-12-24 SUCCESS www.aaa.com
> 2004-12-24 FAILURE www.aaa.com
> 2004-12-24 SUCCESS www.bla.com
> 2004-12-24 FAILURE www.123.com
> 2004-12-24 FAILURE www.bla.com
> 
> Now the url has failed and I would like a 1 sent to a file.....
> 
> So we are checking a log file for failed urls that have also not
> corrected themselves......... Some sort of loop I would imagine, I
> couldn't figure it out... lol
> 
> 
Please show us the Perl code you have tried so far.

jimk


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

Date: Wed, 05 Jan 2005 16:58:17 -0800
From: News Me <newsTWOme@pacifierDOTcom>
Subject: Re: Can You Figure Out This - Looping
Message-Id: <10tp394gi803l8e@corp.supernews.com>

Digger wrote:
> Ok...... I am new at perl, have been at it for a week or so now
> learning.........
> 
> I am trying to do the following....
> 
> I have a log (url.log) file that contains various url's  and some of
> them have errors (indicated with a "FAILURE" in the log file).... Now
> I want to extract these url's that have the "FAILURE". 
> 
> log file format
> 
> date : error message : url
> 
> 
> The problem is this file gets updated every 10 minutes, and in that
> time the url could become valid.......
> 
> example:
> 
> 2004-12-24 FAILURE www.bla.com
> 2004-12-24 SUCCESS www.bla.com
> .........
> 
> So from the above example the url is valid and I would like a 0 sent
> to a file........
> 
> 2004-12-24 FAILURE www.bla.com
> 2004-12-24 SUCCESS www.aaa.com
> 2004-12-24 FAILURE www.aaa.com
> 2004-12-24 SUCCESS www.bla.com
> 2004-12-24 FAILURE www.123.com
> 2004-12-24 FAILURE www.bla.com
> 
> Now the url has failed and I would like a 1 sent to a file.....
> 
> So we are checking a log file for failed urls that have also not
> corrected themselves......... Some sort of loop I would imagine, I
> couldn't figure it out... lol
> 
> 

You don't need perl for that.  On *nix:

bash$ grep FAILURE url.log

On Win32:

C:\> find "FAILURE" url.log

NM



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

Date: Wed, 05 Jan 2005 17:03:27 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Can You Figure Out This - Looping
Message-Id: <050120051703272023%jgibson@mail.arc.nasa.gov>

In article <nhqot0lurfhjv4h6k9m68ifbqlj0ph0smb@4ax.com>, Digger
<hx_101@hotmail.com> wrote:

> Ok...... I am new at perl, have been at it for a week or so now
> learning.........
> 
> I am trying to do the following....
> 
> I have a log (url.log) file that contains various url's  and some of
> them have errors (indicated with a "FAILURE" in the log file).... Now
> I want to extract these url's that have the "FAILURE". 
> 
> log file format
> 
> date : error message : url
> 
> 
> The problem is this file gets updated every 10 minutes, and in that
> time the url could become valid.......
> 
> example:
> 
> 2004-12-24 FAILURE www.bla.com
> 2004-12-24 SUCCESS www.bla.com
> .........

[more description snipped]

This is a good application for a Perl hash (you can say that for 90% of
perl programming problems!) Use the urls as the keys to a hash. Read
through the file, extracting the url name. Set the value of the hash to
0 if the line contains FAILURE and 1 if it contains SUCCESS. After you
have finished reading the entire file, your hash will contain the
current status of all of the URLs in the file. Simple. You should also
read up on Perl regular expressions.

Try 

perldoc perldata
perldoc perlretut

at a command line prompt.

If you have trouble programming this, please post a complete program
that anyone can run and let us know what you think the program should
be doing that it is not.

Good luck, and welcome to the world of Perl!


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---


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

Date: Wed, 5 Jan 2005 18:21:24 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Dummy regex question
Message-Id: <slrnctp144.72k.tadmc@magna.augustmail.com>

Sven-Thorsten Fahrbach <sven-thorsten.fahrbach@gmx.net> wrote:
> JayEs wrote:
> 
> 
>> Given a string that can be:
>> "$ 12.00"
>> "USD 187.54"
>> "CAD 1.20"
>> "??? 12.65"
>> 
>> (the latter due to special characters not avail in ASCII)
>> 
>> How do I split these strings into 2, separating the currency code and the
>> value?
> 

> I don't get why everyone tries to use split() here. 


Because it is the right tool for the job.

You use split() when you know what you want to discard.

You use m// in a list context when you know what you want to keep.


> I'd take a simple
> regexp looking like
> 
> m/(.+)\s+(\d+\.\d+)/
> my ($currency, $amount) = ($1, $2);


You should never use the dollar-digit variables unless you have
first ensured that the pattern match *succeeded*.

   if ( m/(.+)\s+(\d+\.\d+)/ )
      { ($currency, $amount) = ($1, $2) }

or

   my ($currency, $amount) = m/(.+)\s+(\d+\.\d+)/;   # m// in list context


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


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

Date: 6 Jan 2005 00:57:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Dummy regex question
Message-Id: <Xns95D5CB1BBC9B0asu1cornelledu@132.236.56.8>

Scott Bryce <sbryce@scottbryce.com> wrote in
news:gIGdnfrsIe1l_0HcRVn-rQ@comcast.com: 

> JayEs wrote:
> 
>> "Scott Bryce" <sbryce@scottbryce.com> wrote
>> 
>>>The problem is that the character separating the currency and the
>>>amount > is \xA0, which Perl does not recognize as white space.
>> 
>> how did you find that??
> 
> I looked at the output in a hex editor. I suspected something like
> this. 
> 
>> Would HTML::Entities have fixed this
> 
> I doubt it.
> 
>> or this just an artifact of bein on a Win32 box (XP here)?
> 
> I don't know. It could be a "feature" of WWW::Mechanize. I suspect
> that \xA0 is an ANSI non-breaking space. If so, it could be Win32
> specific. 

Oh, come on, take a look at the source code of HTML::Entities:

 nbsp   => "\240", # non breaking space

Sinan

-- 
A. Sinan Unur
1usa@llenroc.ude.invalid 
(remove '.invalid' and reverse each component for email address)



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

Date: Wed, 5 Jan 2005 23:30:38 -0000
From: "Paul D" <please_reply_to_newsgroup@something.com>
Subject: Extra new line inserted in simple program
Message-Id: <crhtaq$u92$1@news.freedom2surf.net>

Hi all

Please forgive me for the simplistic and inefficient nature of the following
program - I am working through the early chapters of a "Teach yourself Perl"
book.

Could someone tell me why Program 1 leaves a gap between the first and
second lines of the descending list of numbers that it outputs, which is in
contrast to Program 2 which prints a continuous list?

I'd be very greatful for your explanation

Many thanks
Paul



= = = = = = = Program 1 = = = = = = =
#!/bin/perl

print ("Enter a number\n");
$number = <STDIN>;
print ("\n\n\n");

$count = $number;
$done = 0;
until ($done == 1) {
 print ($count,"\n");
 if ($count == 1) {
  $done = 1;
 }
 $count = $count - 1;
}


= = = = = = = Program 2 = = = = = = =
#!/bin/perl

$number = 10;
print ("\n\n\n");

$count = $number;
$done = 0;
until ($done == 1) {
 print ($count,"\n");
 if ($count == 1) {
  $done = 1;
 }
 $count = $count - 1;
}




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

Date: Wed, 5 Jan 2005 23:38:15 -0000
From: "Paul D" <please_reply_to_newsgroup@something.com>
Subject: Re: Extra new line inserted in simple program
Message-Id: <crhtp2$uad$1@news.freedom2surf.net>

I am a fool - I have realised that <STDIN> includes an /n.
Using chop($number); resolves the issue.

Apologies for wasting a post.

Thanks
Paul




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

Date: 05 Jan 2005 23:42:02 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Extra new line inserted in simple program
Message-Id: <slrnctouq9.dst.abigail@alexandra.abigail.nl>

Paul D (please_reply_to_newsgroup@something.com) wrote on MMMMCXLV
September MCMXCIII in <URL:news:crhtaq$u92$1@news.freedom2surf.net>:
@@  Hi all
@@  
@@  Please forgive me for the simplistic and inefficient nature of the following
@@  program - I am working through the early chapters of a "Teach yourself Perl"
@@  book.
@@  
@@  Could someone tell me why Program 1 leaves a gap between the first and
@@  second lines of the descending list of numbers that it outputs, which is in
@@  contrast to Program 2 which prints a continuous list?
@@  
@@  I'd be very greatful for your explanation
@@  
@@  Many thanks
@@  Paul
@@  
@@  
@@  
@@ = = = = = = = Program 1 = = = = = = =
@@  #!/bin/perl
@@  
@@  print ("Enter a number\n");
@@  $number = <STDIN>;

This reads in a line from standard input. Lines are terminated with 
a newline, so $number will be a string that ends in a newline.

@@  print ("\n\n\n");
@@  
@@  $count = $number;

$count will now be identical to $number. Hence, $count is a string that
ends in a newline.

@@  $done = 0;
@@  until ($done == 1) {
@@   print ($count,"\n");

Here you print $count and a newline. Since $count already contains a
newline, you print two newlines.

@@   if ($count == 1) {
@@    $done = 1;
@@   }
@@   $count = $count - 1;
@@  }

I'd write that program as follows:

    #!/usr/bin/perl

    use strict;              # Forces you to be precise.
    use warnings;            # Warns you of possible mistakes.
    no warnings 'syntax';    # But some warnings get in the way.

    $| = 1;                  # Turn off buffering. Important because we
                             # are outputting incomplete lines.

    print "Enter a number ";
    my $number = <>;
    chomp $number;           # Strip a possible newline from $number.

    while ($number > 0) {    # No need for a '$done' flag. Or for a copy 
                             # in $count. Just $number will do.
        print $number, "\n";
        -- $number;          # Subtract 1 from $number.
    }

    __END__


The last block could also have been written as:


    print $number --, "\n" while $number > 0;


Abigail
-- 
:$:=~s:$":Just$&another$&:;$:=~s:
:Perl$"Hacker$&:;chop$:;print$:#:


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

Date: Wed, 05 Jan 2005 23:44:12 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Extra new line inserted in simple program
Message-Id: <x73bxfl9v8.fsf@mail.sysarch.com>

>>>>> "PD" == Paul D <please_reply_to_newsgroup@something.com> writes:

  PD> I am a fool - I have realised that <STDIN> includes an /n.
  PD> Using chop($number); resolves the issue.

chomp is safer.

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: Thu, 6 Jan 2005 00:02:31 -0000
From: "Paul D" <please_reply_to_newsgroup@something.com>
Subject: Re: Extra new line inserted in simple program
Message-Id: <crhv6i$uq7$1@news.freedom2surf.net>

Wow - I've never witnessed such a fast response in a newsgroup.

Thank you both very much for your tips.

Best wishes
Paul




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

Date: Wed, 05 Jan 2005 19:24:14 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Extra new line inserted in simple program
Message-Id: <95OdnSx-cquzGEHcRVn-tA@comcast.com>

Paul D wrote:

> Hi all
> 
> Please forgive me for the simplistic and inefficient nature of the
> following program - I am working through the early chapters of a "Teach
> yourself Perl" book.
> 
> Could someone tell me why Program 1 leaves a gap between the first and
> second lines of the descending list of numbers that it outputs, which is
> in contrast to Program 2 which prints a continuous list?
> 
> I'd be very greatful for your explanation
> 
> Many thanks
> Paul
> 
> 
> 
<snipped>

Simple.  The line you get from STDIN still has the line feed it got
when you hit enter to enter it.  You need to use chomp() to get rid
of it.

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


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

Date: Wed, 5 Jan 2005 16:34:48 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: FAQ 4.30: How do I capitalize all the words on one line?
Message-Id: <slrnctoqs8.6j2.tadmc@magna.augustmail.com>

kerb@kerb.eu.org <kerb@kerb.eu.org> wrote:

> $text =~ tr/a-a/A-Z/;


That is an answer to some *other* question, namely:

   How can I make all lower-case "a"s into upper-case "A"s?


But I doubt that that question is asked frequently...


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


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

Date: Thu, 06 Jan 2005 01:45:36 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: FAQ 4.30: How do I capitalize all the words on one line?
Message-Id: <4L0Dd.15972$hc7.1730@trnddc06>

kerb@kerb.eu.org wrote:
> $text =~ tr/a-a/A-Z/;

I suppose you wrote this to uppercase all characters in a text.

Hoewever, even after correcting the obvious error (your code would transpose 
the range from a to a), it still doesn't uppercase all characters:

    use strict; use warnings;
    my $text ='jürgen';
    $text =~ tr/a-z/A-Z/;
    print $text;

This prints
    JüRGEN
while the correctly uppercased text would have been
    JÜRGEN

jue 




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

Date: Thu, 06 Jan 2005 00:06:21 GMT
From: info_at_1-script_dot_com@foo.com (www.1-script.com)
Subject: Re: Having Trouble with a CGI login script
Message-Id: <1i%Cd.247579$lR6.43147@news.easynews.com>

Long listing, so posting on top.

The page where the form you are submitting resides uses Java Script to
fill  'target' and 'argument' values in. Apparently Mechanize cannot
execute that JS for you, you'd have to figure out how to come up with
those values yourself (if it is even possible)

Good luck!

Sincerely,
Dmitri
http://www.1-script.com/1_search/
Get search engine for your site
http://www.1-script.com/install/
Check out my CGI scripts installation offer

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

WhiteFungus@gmail.com wrote:


> I am trying to script a program to autologin for me with the following
> HTML code data.  Although for some reason I can not seem to be able to
> fill the password field properly with WWW::Mechanize.  Is the some
> hidden jewel of syntax structure I am not yet aware of?  Any help
> concerning this issue would be much appreciated!  :)

> -Thanks in advance.
> _______________________________________________________________


> #!usr/bin/perl

> use WWW::Mechanize;
> use WWW::Mechanize::FormFiller;

> my $mech = WWW::Mechanize->new();
> my $formfiller = WWW::Mechanize::FormFiller->new();

> my $username = "user_name";
> my $password = "password";
> my $url = "http://www.myurl.com/default.aspx";

> # Grab the home page, and click the login button to redirect to the
> correct page(HTML listed below).
> $mech->get($url);
> $mech->click_button(number => 1);

> # Set the username and password fields accordingly and submit.
> $mech->set_visible( $username, [password => $password] ) ;
> $mech->submit();

> # Store new HTML content in a temporary file and open it for viewing.
> $html = $mech->content();
> open (OUT,">tmp.html");
> print OUT $html;
> close (OUT);
> system("tmp.html");


> _______________________________________________________________


> <html>
> <head>
> <title>Login</title>
> </head>
> <body bgcolor="#FFFFFF">
> <form id="frmLogin" name="frmLogin"
> method="post"
> action="Login.aspx?__ufps=933290">
> <input type="hidden" name="__VIEWSTATE"
> value="aDxfX1A7QDw716znrKftnYTgo4csMTs+Oz6urRmZvy6aJZj20y+gGEkgSS1/NA==">
> <input type="hidden" name="__EVENTTARGET"
> value="">
> <input type="hidden" name="__EVENTARGUMENT"
> value="">
> <script language=javascript><!--
> function __doPostBack(target, argument){
> var theform = document.frmLogin
> theform.__EVENTTARGET.value = target
> theform.__EVENTARGUMENT.value = argument
> theform.submit()
> }
> // -->
> </script>
> <font size="-1" color="Black">Authorized
> users, please enter your
> trading user ID and password:<br>
> Please enter your user ID:<br>
> <input name="txtUID" size="32"/><br>
> Please enter your password:<br>
> <input name="txtPWD" size="32"
> type="password"/><br>
> <input name="cmdGo" type="image"
> src="Brand/00/go.gif" alt="Go"/><br>
> <input name="cmdHomeFromfrmLogin" type="image"
> src="Brand/00/home.gif"
> alt="Home"/></font></form></body></html>
> _______________________________________________________________







##-----------------------------------------------##
Article posted with Web Developer's USENET Archive
http://www.1-script.com/forums
no-spam read and post WWW interface to your favorite newsgroup - 
comp.lang.perl.misc - 17158 messages and counting!
##-----------------------------------------------##


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

Date: Wed, 5 Jan 2005 18:25:43 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Having Trouble with a CGI login script
Message-Id: <slrnctp1c7.72k.tadmc@magna.augustmail.com>

WhiteFungus@gmail.com <WhiteFungus@gmail.com> wrote:

> #!usr/bin/perl


   use warnings;
   use strict;


You should ask for all the help you can get.


> system("tmp.html");
          ^^^^^^^^

That is an odd name for an executable program...


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


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

Date: 5 Jan 2005 16:36:58 -0800
From: WhiteFungus@gmail.com
Subject: Re: Having Trouble with a CGI login script
Message-Id: <1104971818.929524.205230@z14g2000cwz.googlegroups.com>

Hi,

Thanks for that info. Can you tell me anything
about Javascript::SHA1 or Javascript::MD5? They seem
to be implementable but I'm not certain of their
capabilities.

Thanks again, hope I can crack the code!



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

Date: 5 Jan 2005 16:58:31 -0800
From: WhiteFungus@gmail.com
Subject: Re: Having Trouble with a CGI login script
Message-Id: <1104973111.005182.285490@f14g2000cwb.googlegroups.com>

I found out what the problem is. The errors are not syntaxal. As it
turns out, the problem lays in that i'm attempteing to axcess a
javascript with PERL.



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

Date: 5 Jan 2005 17:55:12 -0800
From: jiing.deng@gmail.com (jiing)
Subject: Is there  a web interface tool that can manage accounts of FreeBSD and Windows 2003 server simultaneously
Message-Id: <b7b95676.0501051755.3205e006@posting.google.com>

Hi all,

Is there such a web interface tool that can manage accounts of FreeBSD
and Windows 2003 server simultaneously.
I need a unique web interface to do the following things:
1. Adminstrator can create shared folder in windows 2003 server via
the web interface
2. Adminstrator can create accounts in FreeBSD via the web interface
3. Users can change their passwords via the web interface
4. Adminstrator can create actual accounts in windows 2003 server via
the web interface

If I want to coding by myself to create such a thing.
What information should I find?

I know we can manage the accounts by phpLDAPAdminm and let users to
change their passwords via web by phpGeneral.
But they are different web interface. (they are both open source,
maybe I can revise them to acheive the goal)
To create share folders still a problem for me.
(someone told me IIS 6 provide a tool to let user, but it's still not
a unique web interface)
Any suggestions are appreciated.

-jiing-


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

Date: Wed, 5 Jan 2005 16:47:25 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Multiple lines of html store in variable non messy way
Message-Id: <slrnctorjt.6j2.tadmc@magna.augustmail.com>

daveyand <andrew.davey@gmail.com> wrote:

> Maybe i am doing something wrong, but i get errors when trying to do
> the above.


If you show us what you've tried, we could help you fix it.

If you don't, we can't.


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


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

Date: Wed, 5 Jan 2005 16:55:31 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Multiple lines of html store in variable non messy way
Message-Id: <slrnctos33.6j2.tadmc@magna.augustmail.com>

daveyand <andrew.davey@gmail.com> wrote:

> $Report = "<html><head>	<stlye>		.greenbold{	font-weight:
> bold;font-color: green;}.redbold{font-weight: bold;font-color: red;}";
> $Report .= "</style></head>";
> 
> How can i change it so that i can do something like:
> 
> $Report <<EndOfHTML;
><html>
><head>
><stlye>
> .greenbold{
> font-weight: bold;
> font-color: green;
> }
> .redbold{
> font-weight: bold;
> font-color: red;
> }
></style>
></head>
> EndOfHTML


   $report =~ tr/ \n/ /s;              # squeeze whitespace
   $report =~ s/(<[^>]*>)\s*/\n$1/g;
   $report =~ s/(\.\w+{)\s*/\n$1\n/g;
   $report =~ s/}/\n}/g;


> Maybe i am doing something wrong, 


Using regular expressions to "parse" HTML is wrong
in many cases.


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


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

Date: Thu, 06 Jan 2005 01:51:13 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Need help sorting fixed length records
Message-Id: <lQ0Dd.15974$hc7.4496@trnddc06>

lbeckm3@hotmail.com wrote:
> I have a rather large file >350 meg that I need to sort on positions
> 88-89 (State).  I've looked at Unix sort command and File::sort in
> perl but haven't been able to figure out how to do this.  All of
> those sorts are based on fields and field delimiters which I don't
> have as the fields are defined by positions, not spaces or :'s etc.!!
> Is there a way to do this?  Thanks in advance!!

Rather simple.
Just define your compare function to look (and compare) only those two 
characters.
You can use substr(), something along the line of (untested, there might be 
a one-off error somewhere):

    substr($a, 88, 2) cmp substr($b, 88, 2)

jue




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

Date: Wed, 5 Jan 2005 18:38:36 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Newbie question: "Get substring of line"
Message-Id: <ZT_Cd.13250$7n1.827072@news20.bellglobal.com>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:scunt0t4krrr49uvtenu2okg26f0evm0fl@4ax.com...
> On Tue, 4 Jan 2005 19:58:34 -0500, "Matt Garrish"
> <matthew.garrish@sympatico.ca> wrote:
>
>>>  (my $str=$_) =~ s/.*=//;  # e.g.
>                              ^^^^^^
>                              ^^^^^^
>
>>Isn't that a little more work than is necessary? (And perhaps a bit 
>>greedy,
>>though it's hard to say.)
>>
>>my ($str) = /[^=]+=(.*)/;
>
>                              # e.g.
>

"e.g." wasn't the issue, though.

> Also, rumors have that regexes using capturing imposes a cost,
> although indeed this will be paid anyway if they're used somewhere
> else in the script.
>

Well how about a benchmark:

use Benchmark;

my $good = q!$_ = 'abc=123'; (my $str=$_) =~ s/.*=//;!;
my $bad = q! my $str = $1 if ...

D'oh!

Matt




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

Date: Wed, 05 Jan 2005 19:42:49 -0500
From: Dominic Dupuis <ddupuis@nospam.org>
Subject: Read a password from keyboard...
Message-Id: <pan.2005.01.06.00.42.48.938481@nospam.org>

Bonjour,

  Does anybody have a way to read a password, from a user, and only
  display "****" for each character read?!?

  Thanks for any idea!  :-)

PS: I want to do that (via a Perl script) on Linux and Windows.


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

Date: Wed, 05 Jan 2005 19:59:24 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Read a password from keyboard...
Message-Id: <N-ydnRNRv7zxEEHcRVn-2w@adelphia.com>

Dominic Dupuis wrote:

>   Does anybody have a way to read a password, from a user, and only
>   display "****" for each character read?!?

That Question is Frequently Asked, so appears in the FAQ:

perldoc -q password

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Thu, 06 Jan 2005 01:53:49 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Read a password from keyboard...
Message-Id: <NS0Dd.15975$hc7.582@trnddc06>

Dominic Dupuis wrote:
>  Does anybody have a way to read a password, from a user, and only
>  display "****" for each character read?!?

Which part of your question is not answered in "perldoc -q password":

    How do I ask the user for a password?


jue 




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

Date: Wed, 5 Jan 2005 17:03:35 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Searching perl script which calls web page and forwards to me / displays with adjusted URLs
Message-Id: <slrnctosi7.6j2.tadmc@magna.augustmail.com>

BG <no@mail.com> wrote:


> I don't use perl.


You are in the wrong place then.


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


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

Date: Thu, 06 Jan 2005 00:50:50 GMT
From: info_at_1-script_dot_com@foo.com (www.1-script.com)
Subject: Re: Searching perl script which calls web page and forwards to me / displays with adjusted URLs
Message-Id: <KX%Cd.248894$2W1.25001@news.easynews.com>


Tom Parson wrote:


> My company where I am working offers an internet access but filters out
> some web
> pages like ebay
> by a firewall. So I cannot access ebay auctions web page directly.

> However I have access to another server which is NOT filtered out by
> our
> firewall.

> I am searching now I perl script which I can install on the third party
> server
> and which acts as
> an intermediate broker between me and ebay.

> For that I want to enter the real ebay address into an entry filed on a
> web page
> on the middle
> server. The perl script should fetch the entered ebay web page, then
> change the
> ebay URLs inside
> and display the modified page to me. When I click now on some links
> inside the
> modified
> web pages the new link should be transferred to the middle server which
> in turn
> gets the next page
> and so on.

> Does there such a perl script exist?

> Tom

Just google for web proxy or anonymous proxy. You may not even have to
install a script, just use someone's services.


Sincerely,
Dmitri
http://www.1-script.com/1_search/
Get search engine for your site
http://www.1-script.com/install/
Check out my CGI scripts installation offer

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




##-----------------------------------------------##
Article posted with Web Developer's USENET Archive
http://www.1-script.com/forums
no-spam read and post WWW interface to your favorite newsgroup - 
comp.lang.perl.misc - 17165 messages and counting!
##-----------------------------------------------##


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

Date: Wed, 5 Jan 2005 17:05:46 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: sort directory help
Message-Id: <slrnctosma.6j2.tadmc@magna.augustmail.com>

Jake Wiley <OEKilla@msn.com> wrote:

> my @sorted =
> map{ $_->[0] }
> sort { $a->[1] <=> $b->[1] }
> map { [$_, parsedate($_)] } @dates;

> Why the error message about "Use of uninitialized value in numeric
> comparison (<=>)"


Because parsedate() returned undef.

Consult the function's documentation to see why it
might do that.


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


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

Date: 5 Jan 2005 15:20:11 -0800
From: "g3000" <carlton_gregory@yahoo.com>
Subject: Re: specifying use strict
Message-Id: <1104967211.862258.270490@c13g2000cwb.googlegroups.com>

Thanks Uri.

I downloaded your module.

Unzipped it to C:\Perl\lib ( just the Slurp.pm, slurp_article and
slurp_bench files)

That path is in @INC.

But perl says it cant find it.
Can't locate File/Slurp.pm in @INC (@INC contains: C:\Perl\lib
 ....<snip>

C:\Perl\lib is the first path in @INC.
I also have C:\Perl\lib\File-Slurp-9999.06 folder.

Any ideas?



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

Date: Wed, 05 Jan 2005 18:27:55 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: specifying use strict
Message-Id: <tLydnXHd9YJh6kHcRVn-iw@adelphia.com>

g3000 wrote:

> I downloaded your module.
> 
> Unzipped it to C:\Perl\lib

That's not how the docs say to install modules.

Have a look at "perldoc perlmodinstall".

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Wed, 5 Jan 2005 18:53:12 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: specifying use strict
Message-Id: <F5%Cd.13260$7n1.830051@news20.bellglobal.com>


"Sherm Pendley" <spamtrap@dot-app.org> wrote in message 
news:tLydnXHd9YJh6kHcRVn-iw@adelphia.com...
> g3000 wrote:
>
>> I downloaded your module.
>>
>> Unzipped it to C:\Perl\lib
>
> That's not how the docs say to install modules.
>
> Have a look at "perldoc perlmodinstall".
>

It's not the most useful perldoc if you're running Perl on Windows. It 
assumes your options are ppm or make, without ever really explaining what 
ppm is (or that Indigo Perl exists and has its own package manager).

Matt 




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

Date: 5 Jan 2005 17:50:43 -0800
From: "g3000" <carlton_gregory@yahoo.com>
Subject: Re: specifying use strict
Message-Id: <1104976243.472021.264760@c13g2000cwb.googlegroups.com>

I usually use active states ppm3 but I couldnt find a .ppd file that
was for the latest version of File::Slurp.
Ill look again. The one active state has is from Nov 2001.



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

Date: 5 Jan 2005 15:08:16 -0800
From: "Jim Monty" <jimmonty@gmail.com>
Subject: What happened with this year's Perl Advent Calendar?
Message-Id: <1104966496.934933.135630@f14g2000cwb.googlegroups.com>

What happened with this year's Perl Advent Calendar
<http://www.perladvent.org/2004/>? It stalled on Day 21.

I pinged Mark Fowler by email but didn't get a response. I hope all's
well. I really enjoy his annual Perl module exegeses.

Jim Monty



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

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 V10 Issue 7610
***************************************


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