Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

perl-beginner · Perl Beginners Mailing List

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 3765
  • Category: Perl
  • Founded: Aug 2, 1998
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 22771 - 22800 of 27459   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#22771 From: "buxh42a" <buxh42a@...>
Date: Mon Feb 6, 2006 4:54 pm
Subject: Re: [PBML] Installing CPAN modules to your own private directories
buxh42a
Send Email Send Email
 
This is what I type and get back:

$ perl Makefile.PL INSTALLDIRS=site INSTALLSITELIB=$HOME/perl/private_libs

Perl-5.7 provide experimental core support for Unicode strings.  You
can compile HTML::Entities so that Unicode entities like € and
€ are decoded into a string containing "\x{20AC}".  If you
select no to the question below such entities will be left alone and
only entities in the Latin-1 range is decoded.

Do you want decoding on unicode entities? [no] no
Writing Makefile for HTML::Parser

$ make install
cc -c   -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit
-DVERSION=\"3.26\" -DXS_VERSION=\"3.26\" +Z
"-I/opt/perl/lib/5.8.2/PA-RISC2.0/CORE"  -DMARKED_SECTION Parser.c
cc: "/usr/include/sys/socket.h", line 504: warning 562: Redeclaration
of "sendfile" with a different storage class specifier: "sendfile"
will have internal linkage.
cc: "/usr/include/sys/socket.h", line 505: warning 562: Redeclaration
of "sendpath" with a different storage class specifier: "sendpath"
will have internal linkage.
Running Mkbootstrap for HTML::Parser ()
chmod 644 Parser.bs
rm -f blib/arch/auto/HTML/Parser/Parser.sl
LD_RUN_PATH="" /usr/bin/ld  -b +vnocompatwarnings -L/usr/local/lib
Parser.o  -o blib/arch/auto/HTML/Parser/Parser.sl
chmod 755 blib/arch/auto/HTML/Parser/Parser.sl
cp Parser.bs blib/arch/auto/HTML/Parser/Parser.bs
chmod 644 blib/arch/auto/HTML/Parser/Parser.bs
Manifying blib/man3/HTML::PullParser.3
Manifying blib/man3/HTML::Entities.3
Manifying blib/man3/HTML::Parser.3
Manifying blib/man3/HTML::TokeParser.3
Manifying blib/man3/HTML::LinkExtor.3
Manifying blib/man3/HTML::HeadParser.3
Manifying blib/man3/HTML::Filter.3
Warning: You do not have permissions to install into
/opt/perl/lib/site_perl/5.8.2/PA-RISC2.0 at
/opt/perl/lib/5.8.2/ExtUtils/Install.pm line 114.
Cannot forceunlink
/opt/perl/lib/site_perl/5.8.2/PA-RISC2.0/auto/HTML/Parser/Parser.sl:
Permission denied at /opt/perl/lib/5.8.2/File/Find.pm line 856
make: *** [pure_site_install] Error 255

--- In perl-beginner@yahoogroups.com, Paul Archer <tigger@...> wrote:
>
> 4:12pm, buxh42a wrote:
>
> > Hi
> >  I have downloaded a few CPAN modules that I think would help me, but
> > I am having trouble installing them into my own private directories (I
> > don't have permissions to install them into the usual Perl
directories).
> >
> > I am trying to install the HTML-Parser module like this:
> >
> > perl Makefile.PL INSTALLDIRS=site
INSTALLSITELIB=$HOME/perl/private_libs
> >
> > perl -e Makefile.pl
> >
> Why are you running 'perl Makefile.pl' twice? The second time
overwrites the
> output generated the first time.
>
> Also, you might try:
> INSTALLDIRS=site INSTALLSITELIB=$HOME/perl/private_libs perl Makefile.pl
>
> Paul
>

#22772 From: perrel_gps_984@...
Date: Mon Feb 6, 2006 4:56 pm
Subject: How the Stock Market Works - easy 4 step guide
perrel_gps_984
Send Email Send Email
 
This four step guide will give you the foundation you always wanted. Learning
the basics in handling stocks.

  This guide will help anyone, intrested in getting into the stocks game. Once
you follow through the guide, you will understand it's no rocket science. Only
thing is nobody ever try to explain it you from A to Z. Start now, just have a
look,

http://www.myjobhome.com/amex/

Step 1 - Basics
http://www.myjobhome.com/amex/Ameritrade-part1.htm

Step 2 - Initial Public Offerings
http://www.myjobhome.com/amex/Ameritrade-Part2.htm

Step 3 - Stock Market Players
http://www.myjobhome.com/amex/Ameritrade-Part3.htm

Step 4 - The Life of a Trade
http://www.myjobhome.com/amex/Ameritrade-Part4.htm





______________________________________________________________

If you think this email is spam
UNSUBSCRIBE - Please send an email to shadow1lk@...

#22773 From: "interrobang" <CedricCicada@...>
Date: Mon Feb 6, 2006 6:48 pm
Subject: Re: How the Stock Market Works - easy 4 step guide
interrobang
Send Email Send Email
 
The person who posted this message is now on moderated status.  Any
future posts from him will require the approval of a moderator.

I don't know if when he joined the group or if he has participated in
the past.  I put him on moderated status instead of banning him because
I don't know if he has made legitimate posts before.

Rob Richardson
New moderator, PerlBeginner@yahoogroups.com

#22774 From: JC <jchaser@...>
Date: Mon Feb 6, 2006 7:50 pm
Subject: Optimal way to parse an IP address
jchaser
Send Email Send Email
 
Hello All,

I've seen the following ways to used to parse an IP
address

1) (\S+)
2) ([d\.]+)
3) (\d+\.\d+\.\d+\.\d+)
4) (.*?)
5) (.{7,15})

I personally am fond of

(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})

I like the forementioned method as it constrains the
input to a particular length and a particular type of
character. Is anyone aware of a more optimal way?

Thanks in advance,

JC

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#22775 From: Rob Richardson <CedricCicada@...>
Date: Tue Feb 7, 2006 1:17 am
Subject: How to access modules and global variables
interrobang
Send Email Send Email
 
Greetings!

I am not a Perl developer.  I am a C#/VB/C++ developer.  I entered this
grotesque world of Perl only because a volunteer organization I belong to
had the misfortune to have somebody put together a web page with Perl code
behind it when all he had was a book on Perl and no experience.  I muddled
my way through, folded, spindled and mutilated the code into some semblance
of organization, and got it running on the organization's old Unix host.

Now, we have changed hosts.  We're on Windows.  Eventually, I will convert
the page to ASP.Net, but until then, I have to make the old Perl code work
under Windows.  The rules I thought I understood reasonably well under Unix
have changed.

The following discussion pertains to a module I wrote that merely writes
text into a file, and a little test program that exercises that module.

First question:  How do I refer to modules without having to include their
package names?  Here's the test program:


#!/usr/bin/perl
print "Content-type: text/html\n\n";

use warnings;
use strict;

use FindBin;
use lib $FindBin::Bin;

my $crewPath = $FindBin::Bin . '/crew';
my $dataPath = $FindBin::Bin . '/data';

print "Script location: $FindBin::Bin<br>Crew path: $crewPath<br>Data path:
$dataPath<br>";

use Trace qw(trace);
Trace::trace ("This is from the tracetest program.\n");

This script works, although trace() doesn't yet (more on that later).  The
first question is: Why do I have to use "Trace::trace()"?  If I try just
trace("..."), I get a compile error telling me Perl can't find
$main::trace().  But earlier, before I learned about use lib, I was getting
an error saying that module Trace.pm couldn't be found.  So, tracetest.pl is
finding Trace.pm, but it isn't letting me use it without the package name.
Why not?  What do I have to do to avoid the package name?



$dataPath is supposed to be a globally accessible variable that holds the
folder that contains my data files.  In Trace::trace(), the file I want to
write to is contained in $dataPath.  Here's the output of my script as it
exists:

Script location: d:/Customers/user1194373/www/crew
Crew path: d:/Customers/user1194373/www/crew/crew
Data path: d:/Customers/user1194373/www/crew/data
Inside trace(); data path:
Software error:

Could not open trace file >>/trace.log: Permission denied

Notice that inside tracetest.pl, $dataPath points to the folder I want to
use.  But when I get into my Trace module, $main::dataPath is still defined
(because I'd get a compile error if it wasn't), but it's empty!  What's
going on here?  I normally don't like global variables, but storing the
names of folders my application will be using seems reasonable.  I don't
want to have to pass these folder names in to every function in every module
I call.

In case you're curious, here's the module:


package Trace;

use strict;
use warnings;

sub trace
{
print ("Inside trace(); data path: $main::dataPath<br>");
my $message = shift;
my $traceFile = ">>" . $main::dataPath . '/trace.log';
open (TRACE, $traceFile) or die "Could not open trace file $traceFile:
$!\n";
print TRACE $message;
close TRACE;
}

my $motto = "Who invented this furshlugginer language anyway?";

Thank you for your assistance!

Rob Richardson


[Non-text portions of this message have been removed]

#22776 From: "John J. Francini" <francini@...>
Date: Tue Feb 7, 2006 6:20 am
Subject: Re: [PBML] How to access modules and global variables
francini@...
Send Email Send Email
 
Rob,

It doesn't do you any favors to start out a request for Perl help by
bad-mouthing the language.

I could make snide comments about how thoroughly you've drunk the
Microsoft Kool-Aid that you want to move this code from a fine
platform-independent language (like Perl) to a vendor-locked-in
language foisted on the world by a convicted monopolist.

But I won't. ;-)

As to the specific problem: you're not exporting the functions,
variables, or classes in the Trace.pm module.  If you have access to
the O'Reilly Perl Cookbook, check out Recipe 12.1 on "Defining a
Module's Interface".

I will quote the relevant section below.

[quote]
Problem

You want the standard Exporter module to define the external
interface to your module.


Solution

In module file YourModule.pm, place the following code. Fill in the
ellipses as explained in the Discussion section.

package YourModule;
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);

use Exporter;
$VERSION = 1.00;              # Or higher
@ISA = qw(Exporter);

@EXPORT      = qw(...);       # Symbols to autoexport (:DEFAULT tag)
@EXPORT_OK   = qw(...);       # Symbols to export on request
%EXPORT_TAGS = (              # Define names for sets of symbols
      TAG1 => [...],
      TAG2 => [...],
      ...
);

########################
# your code goes here
########################

1;                            # this should be your last line



In other files where you want to use YourModule, choose one of these lines:

use YourModule;               # Import default symbols into my package.
use YourModule qw(...);       # Import listed symbols into my package.
use YourModule ();            # Do not import any symbols
use YourModule qw(:TAG1);     # Import whole tag set


Discussion

The standard Exporter module handles the module's external interface.
Although you could define your own import method for your package,
almost no one does this. When someone says use YourModule, this does
a require "YourModule.pm" statement followed a YourModule->import()
method call, both during compile time. The import method inherited
from the Exporter package looks for global variables in your package
to govern its behavior. Because they must be package globals, we've
declared them with the use vars pragma to satisfy use strict. These
variables are:

$VERSION
When a module is loaded, a minimal required version number can be
supplied. If the version isn't at least this high, the use will raise
an exception.

	 use YourModule 1.86; # If $VERSION < 1.86, fail

@EXPORT
This array contains a list of functions and variables that will be
exported into the caller's own namespace so they can be accessed
without being fully qualified. Typically, a qw() list is used.

	     @EXPORT = qw(&F1 &F2 @List);
	     @EXPORT = qw( F1  F2 @List);        # same thing

When a simple use YourModule call is made, the function &F1 can be
called as F1() rather than YourModule::F1() and the array can be
accessed as @List instead of @YourModule::List. The ampersand is
optional in front of an exported function specification.

To load the module at compile time but request that no symbols be
exported, use the special form use Exporter (), with empty
parentheses.

@EXPORT_OK
This array contains symbols that can be imported if they're
specifically asked for. If the array were loaded this way:

	     @EXPORT_OK = qw(Op_Func %Table);

Then the user could load the module like so:

	     use YourModule qw(Op_Func %Table F1);

and import only the Op_Func function, the %Table hash, and the F1
function. The F1 function was listed in the @EXPORT array. Notice
that this does not automatically import F2 or @List, even though
they're in @EXPORT. To get everything in @EXPORT plus extras from
@EXPORT_OK, use the special :DEFAULT tag, such as:

	     use YourModule qw(:DEFAULT %Table);

%EXPORT_TAGS
This hash is used by large modules like CGI or POSIX to create
higher-level groupings of related import symbols. Its values are
references to arrays of symbol names, all of which must be in either
@EXPORT or @EXPORT_OK. Here's a sample initialization:

	     %EXPORT_TAGS = (
	         Functions => [ qw(F1 F2 Op_Func) ],
	         Variables => [ qw(@List %Table)  ],
	     );

An import symbol with a leading colon means to import a whole group
of symbols. Here's an example:

	     use YourModule qw(:Functions %Table);

That pulls in all the symbols from

	     @{ $YourModule::EXPORT_TAGS{Functions} },

that is, it pulls in the F1, F2, and Op_Func functions and then the
%Table hash.

Although you don't list it in %EXPORT_TAGS, the implicit tag :DEFAULT
automatically means everything in @EXPORT. You don't have to have all
those variables defined in your module. You just need the ones that
you expect people to be able to use.
[end quote]

Note the last line above. Unless you're going to use every single
funky variable and function from the Trace.pm module, you should only
export what needs to be exported, and leave the rest module-private.

Hope this helps,

John Francini



--
----
John Francini <mailto:francini@...>
+---------------------------------------------------------------------------+
| "I have come to the conclusion that one useless man is called a disgrace; |
|  that two are called a law firm; and that three or more become a Congress.|
|  And by God I have had _this_ Congress!"                                  |
|                                                       -- John Adams       |
+---------------------------------------------------------------------------+

[Non-text portions of this message have been removed]

#22777 From: Habeeb <mail2habeeb2003@...>
Date: Tue Feb 7, 2006 9:47 am
Subject: Sybase,Perl and Unix Shell Programming
mail2habeeb2003
Send Email Send Email
 
Hi,

   Peri Software Solutions is looking for Sybase,Perl and Unix Shell Programming
Candidates. Kindly send me your Updated Resumes to resumes@...

   Requirement:

   Sybase,PERL and UNIX Shell Programming

   Education: Any

   Exp  : 3+yrs


   Thanks & Regards

   Habeeb
   resumes@...
   www.perisoftware.com

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

[Non-text portions of this message have been removed]

#22778 From: "kathyconuremom" <conuremom@...>
Date: Tue Feb 7, 2006 7:39 pm
Subject: absolute total newbie needs help with addition
kathyconuremom
Send Email Send Email
 
I need to preface this by saying I am not a programmer, and other than
some HTML stuff, I haven't done any programming since college in 1982
(anybody remember punch cards and COBOL?).  I am figuring out what I
need to do with PERL by searching the web and trying different examples
from tutorials.

I was recently coerced into taking a position as webmaster of a
fundraiser site, and I need a bit of help setting something up.

Here's the situation--
I'm going to be running purchased auction software (Auctionawy) that is
written in PERL. I'm trying to alter an HTML formatted winning bidder
letter so that it adds together the data contained in two auction
variables (winning bid and shipping fee) to create a total amount due.

I ended up having to go into the PERL scripts to make the necessary
changes to the letter because I couldn't add the variables in
javascript either. I feel like a very old first-grader who can't figure
out how to do her homework. :'P

I've been all over the web looking for examples of how to do addition
using variables in PERL. It seems straightforward enough in the
examples, but no matter what I do, I can't seem to make it work. Once
in a while I can get a zero to appear in the field where the total
should be, but that's the most I can accomplish.  I'm getting more than
a little frustrated, and I really need to get this solved soon so I can
get the site up and running.

The letter I'm altering is a subroutine of a 1300+ line PERL program.

Before I slap the subroutine into this message and get booted off the
board, would it be better to cut and paste just the text of the
subroutine here, or put the whole text file on a website somewhere so
those more experienced than I can see the whole mess together?

--Kathy

#22779 From: "J.E. Cripps" <cycmn@...>
Date: Tue Feb 7, 2006 8:04 pm
Subject: Re: [PBML] absolute total newbie needs help with addition
cycmn@...
Send Email Send Email
 
> I need to preface this by saying I am not a programmer, and other than
> some HTML stuff, I haven't done any programming since college in 1982
> (anybody remember punch cards and COBOL?).  I am figuring out what I
> need to do with PERL by searching the web and trying different examples
> from tutorials.

> I've been all over the web looking for examples of how to do addition
> using variables in PERL.

Whoa.  Buy a book, or more likely, book(s).

    I detect a residue in your personal noosphere from the
    COBOL days.  Don't try to learn Perl solely from reading
    existing code and trying to finagle variations.  This
    was, unhappily  the way numerous COBOL programmers
    started, and even less happily, how they finished, and
    even worse, how they would counsel other newcomers
    to attempt to learn the language and programming in general.

    I owe numerous debts to certain self-described mainframe
    bigots, e.g. their rejection out of hand of any so-called
    OS for which the source code was not available (even at
    great cost, or only to certain qualified personnel; there
    were limitations alas on their advocacy also)  "If it's
    not source, it's not software."

    But the most painful recollection of my contacts with
    these persons was their utter, and now incomprehensible
    disdain for post-Gutenberg modes of instruction, and the
    ridicule they would greet any non-manual printed matter.

    Attempting to learn even a little Perl the way they
    learned COBOL, and the way you are trying is a recipe for
    misery without consolations.  Get your book(s) read
    them, do some examples,   do some variations, the next day attempt to
    recall the examples...   you will have frustrations and suffer
    bafflement but you will also experience satisfaction if you persevere.


Addenda vel prolegomena:

    1. It's perl or Perl, not PERL.

    2. We're a list, not a board.


More reply:

> You Before I slap the subroutine into this message and get booted off
> board, would it be better to cut and paste just the text of the
> subroutine here, or put the whole text file on a website somewhere so
> those more experienced than I can see the whole mess together?

    Normally we welcome code snippets, but there is a distinct
    probability that there is more involved here than an  imperfect
    understanding of elementary variables and arithmetic, this might
    not be especially helpful here.

    Since you say you didn't write the code, it would might
    also be premature to call it a "mess"

#22780 From: Rob Richardson <CedricCicada@...>
Date: Tue Feb 7, 2006 8:21 pm
Subject: Re: [PBML] absolute total newbie needs help with addition
interrobang
Send Email Send Email
 
What happens when you try the addition?  Do you get any error messages?
Have you tried any tiny programs in which you create two variables, set them
to some numbers, add them, and print the results?

RobR


[Non-text portions of this message have been removed]

#22781 From: "Ken at Home" <ken@...>
Date: Tue Feb 7, 2006 8:31 pm
Subject: Re: [PBML] absolute total newbie needs help with addition
kenshail2003
Send Email Send Email
 
It is normal to reply at the bottom, but your question is quite long.

Do I gather that you need a simple calculator written in Perl to add-up
amounts on a web page?
If so, it can be done quite simply with CGI used to pass the amounts to
another page after clicking a "calculate"button . They can then be added and
the result be part of the n new page. It can even pass the amounts to itself
so that the user sees the result of the arithmetic on the same page.
A simple method of generating the page is for Perl to print the HTML strings
and interject the resulting variable at the approprate place.
If you would like to email me direct I could send a simple example.



I need to preface this by saying I am not a programmer, and other than
some HTML stuff, I haven't done any programming since college in 1982
(anybody remember punch cards and COBOL?).  I am figuring out what I
need to do with PERL by searching the web and trying different examples
from tutorials.

I was recently coerced into taking a position as webmaster of a
fundraiser site, and I need a bit of help setting something up.

Here's the situation--
I'm going to be running purchased auction software (Auctionawy) that is
written in PERL. I'm trying to alter an HTML formatted winning bidder
letter so that it adds together the data contained in two auction
variables (winning bid and shipping fee) to create a total amount due.

I ended up having to go into the PERL scripts to make the necessary
changes to the letter because I couldn't add the variables in
javascript either. I feel like a very old first-grader who can't figure
out how to do her homework. :'P

I've been all over the web looking for examples of how to do addition
using variables in PERL. It seems straightforward enough in the
examples, but no matter what I do, I can't seem to make it work. Once
in a while I can get a zero to appear in the field where the total
should be, but that's the most I can accomplish.  I'm getting more than
a little frustrated, and I really need to get this solved soon so I can
get the site up and running.

The letter I'm altering is a subroutine of a 1300+ line PERL program.

Before I slap the subroutine into this message and get booted off the
board, would it be better to cut and paste just the text of the
subroutine here, or put the whole text file on a website somewhere so
those more experienced than I can see the whole mess together?

--Kathy

#22782 From: Donato Azevedo <donatoaz@...>
Date: Tue Feb 7, 2006 8:53 pm
Subject: Re: [PBML] Optimal way to parse an IP address
donatoufmg
Send Email Send Email
 
On 2/6/06, JC <jchaser@...> wrote:
> Hello All,
>
> I've seen the following ways to used to parse an IP
> address
>
> 1) (\S+)
> 2) ([d\.]+)
> 3) (\d+\.\d+\.\d+\.\d+)
> 4) (.*?)
> 5) (.{7,15})
>
> I personally am fond of
>
> (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
>
> I like the forementioned method as it constrains the
> input to a particular length and a particular type of
> character. Is anyone aware of a more optimal way?

None of the ways you presented are precisely accurate, for there are
forbidden IP values like 999.999.999.999.
a more accurate way may be found at:
http://www.regular-expressions.info/regexbuddy/ipaccurate.html

or without the explanation:
\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[\
0-9][0-9]?)\b

regards,

--
------------------------------------------------------------------------
Donato Azevedo - UFMG - Eng Ctrl Aut
the first rule of Perl Club is you don't talk about Perl Club
Slackware user #390325

#22783 From: JC <jchaser@...>
Date: Tue Feb 7, 2006 9:49 pm
Subject: Re: [PBML] Optimal way to parse an IP address
jchaser
Send Email Send Email
 
Thanks for the feedback

> None of the ways you presented are precisely
> accurate, for there are
> forbidden IP values like 999.999.999.999.
> a more accurate way may be found at:
>
http://www.regular-expressions.info/regexbuddy/ipaccurate.html
>
> or without the explanation:
>
\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[\
0-9][0-9]?)\b
>

Best,

JC

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#22784 From: merlyn@...
Date: Tue Feb 7, 2006 11:51 pm
Subject: Re: [PBML] Optimal way to parse an IP address
merlynstoneh...
Send Email Send Email
 
>>>>> "JC" == JC  <jchaser@...> writes:

JC> Thanks for the feedback
>> None of the ways you presented are precisely
>> accurate, for there are
>> forbidden IP values like 999.999.999.999.
>> a more accurate way may be found at:
>>
JC> http://www.regular-expressions.info/regexbuddy/ipaccurate.html
>>
>> or without the explanation:
>>
JC>
\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[\
0-9][0-9]?)\b
>>

That regex fails on the perfectly legal "127.1".

Why do people insist on inventing regex validations without reading the
requirements?  {sigh}


--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#22785 From: "Charles K. Clarkson" <cclarkson@...>
Date: Wed Feb 8, 2006 12:19 am
Subject: RE: [PBML] absolute total newbie needs help with addition
charlesclarkson
Send Email Send Email
 
kathyconuremom wrote:

: I'm going to be running purchased auction software (Auctionawy)
: that is written in PERL. I'm trying to alter an HTML formatted
: winning bidder letter so that it adds together the data contained
: in two auction variables (winning bid and shipping fee) to create
: a total amount due.


     Have you tried asking this question at mewsoft? Someone
has probably answered your question before.

     http://www.mewsoft.com/forums/


HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328

#22786 From: "Kathy Johnson" <conuremom@...>
Date: Wed Feb 8, 2006 2:08 am
Subject: Re: [PBML] absolute total newbie needs help with addition
kathyconuremom
Send Email Send Email
 
>    Have you tried asking this question at mewsoft? Someone
> has probably answered your question before.
>
>    http://www.mewsoft.com/forums/

Oh yes, I've literally read thru that entire forum, and thre's nothing
even vaguely like my question out there. I have asked Ahmed (the
author) several times. I'm not communicating what I need clearly
enough, I fear.

--Kathy

#22787 From: kshkid <madhanagopalm@...>
Date: Wed Feb 8, 2006 10:07 am
Subject: ftp ing to a server
matrixconquers
Send Email Send Email
 
hi all,

with username, pwd, machinename

i could a ftp to unix box from windows

i would like to do this in perl scripting.

could u please help with this?

thanks,
Mad.


[Non-text portions of this message have been removed]

#22788 From: "Damien Carbery" <daymobrew@...>
Date: Wed Feb 8, 2006 11:21 am
Subject: Re: ftp ing to a server
daymobrew
Send Email Send Email
 
--- In perl-beginner@yahoogroups.com, kshkid <madhanagopalm@...> wrote:
>
> hi all,
>
> with username, pwd, machinename
>
> i could a ftp to unix box from windows
>
> i would like to do this in perl scripting.
>
> could u please help with this?
>
> thanks,
> Mad.

See the Net::FTP module.
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/lib/Net/FTP.html

Use the debug option to help you determine what is wrong when you
encounter an error.
Check the result of each function call.

#22789 From: kshkid <madhanagopalm@...>
Date: Wed Feb 8, 2006 12:36 pm
Subject: Re: [PBML] Re: ftp ing to a server
matrixconquers
Send Email Send Email
 
thank u so much for the reply,

could you please throw some light on executing 100 instances of perl program
(for the above FTP) concurrently to 100 different servers


On 2/8/06, Damien Carbery <daymobrew@...> wrote:
>
> --- In perl-beginner@yahoogroups.com, kshkid <madhanagopalm@...> wrote:
> >
> > hi all,
> >
> > with username, pwd, machinename
> >
> > i could a ftp to unix box from windows
> >
> > i would like to do this in perl scripting.
> >
> > could u please help with this?
> >
> > thanks,
> > Mad.
>
> See the Net::FTP module.
> http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/lib/Net/FTP.html
>
> Use the debug option to help you determine what is wrong when you
> encounter an error.
> Check the result of each function call.
>
>
>
>
>
>
> Unsubscribing info is here:
> http://help.yahoo.com/help/us/groups/groups-32.html
> Yahoo! Groups Links
>
>
>
>
>
>
>


[Non-text portions of this message have been removed]

#22790 From: "Jenda Krynicky" <Jenda@...>
Date: Wed Feb 8, 2006 10:01 pm
Subject: Re: [PBML] Optimal way to parse an IP address
jendaperl
Send Email Send Email
 
From: merlyn@...
> >>>>> "JC" == JC  <jchaser@...> writes:
>
> JC> Thanks for the feedback
> >> None of the ways you presented are precisely
> >> accurate, for there are
> >> forbidden IP values like 999.999.999.999.
> >> a more accurate way may be found at:
> >>
> JC> http://www.regular-expressions.info/regexbuddy/ipaccurate.html >>
> >> or without the explanation: >> JC>
> \b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0
> -9]|[01]?[0-9][0-9]?)\b >>
>
> That regex fails on the perfectly legal "127.1".
>
> Why do people insist on inventing regex validations without reading
> the requirements?  {sigh}

What was the last time you've seen something like this used as an IP
address. If you don't count spams trying to make you go to a spoof of
some bank webpages (http://www.yourbank.com@165432468/login/).

There's legal and legal. And for 99.999% of applications that regexp
is more correct than one that'd allow 127.1 would be. IMHO of course.

Jenda
===== Jenda@... === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
	 -- Terry Pratchett in Sourcery

#22791 From: "ed_tsang" <edwardt.tril@...>
Date: Wed Feb 8, 2006 10:31 pm
Subject: why it is print 9?
ed_tsang
Send Email Send Email
 
sub f1{

	 my ($a) =@_;
	 $cp=1;
         $LOCAL_CODEPAGE =10;
	 if ($a==1){
		 $LOCAL_CODEPAGE = $cp;
		 break;
	 }
	 return $LOCAL_CODEPAGE = $a;
	 print "\n";
}


print "\$LOCAL_CODEPAGE=$LOCAL_CODEPAGE: f1(@1,9,3,4,5):
".f1(@1,9,3,4,5)."\n";

it prints 9. I am expecting to print nothing. why the shift to 9? I
have not used shift inside the subroutine.
thanks

#22792 From: "saeph69" <sadiahasan@...>
Date: Wed Feb 8, 2006 11:21 pm
Subject: How do you send a variable to another script?
saeph69
Send Email Send Email
 
Hi everyone,

First time posting here, so please be gentle:)  I have posted this
question in another forum but wasn't able to get the answer I was
looking for.  So my apologies in advance for the cross-post.  Here is
what I am trying to do:

I have a dynamically generated list of widget names on Server A. I
have a realtime logfile of all the widget historical activities for
the past X months on Server B. When my client clicks on a widget name,
I need to be able to send the widget name to Server B as a variable so
a second script on Server B can parse and process that name against
the historical log.

I have been able to do this when I use a form and the 'POST' method.
For security reasons, I cannot pass these in the URL using the 'GET'
method. What are my options, other than using a form, to pass a
variable from one script to another, both residing on separate
servers? Both servers reside on the same network in an intranet
environment.

Thanks in advance for your help.

#22793 From: merlyn@...
Date: Thu Feb 9, 2006 2:06 am
Subject: Re: [PBML] Optimal way to parse an IP address
merlynstoneh...
Send Email Send Email
 
>>>>> "Jenda" == Jenda Krynicky <Jenda@...> writes:

Jenda> What was the last time you've seen something like this used as an IP
Jenda> address.

That is so *completely* not the point.

If you say "this regex validates legal IP addresses", it better damn well
follow the spec.  If you say "this regex validates legal email addresses",
it better damn well follow the spec.

If you say "this regex validates most of the IP addresses I've seen",
you can get away with sloppiness.

But that wasn't what was said.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#22794 From: "Charles K. Clarkson" <cclarkson@...>
Date: Thu Feb 9, 2006 3:15 am
Subject: RE: [PBML] why it is print 9?
charlesclarkson
Send Email Send Email
 
ed_tsang wrote:

: sub f1{
:
:  my ($a) =@_;
:  $cp=1;
:         $LOCAL_CODEPAGE =10;
:  if ($a==1){
: 	 $LOCAL_CODEPAGE = $cp;
: 	 break;
:  }
:  return $LOCAL_CODEPAGE = $a;
:  print "\n";
: }
:
:
: print "\$LOCAL_CODEPAGE=$LOCAL_CODEPAGE: f1(@1,9,3,4,5):
: ".f1(@1,9,3,4,5)."\n";
:
: it prints 9. I am expecting to print nothing.
: why the shift to 9?

     There is no shift of @_. @1 is a perl global variable.
I have no idea what it is for or why you are using it.
For some reason, when combining it with the comma operator
it is interpolated as if it was never there. This yields
the same result.

f1(@1,@1,@1,@1,@1,@1,@1,@1,@1,@1,@1,@1,@1,@1,9,3,4,5)

     The big question is why you are using @1 as a variable.
Did you mean f1(1,9,3,4,5)?


     Start your scripts off with these modules. They will
help catch many of the errors you'll run into as you
transition to perl.

use strict;
use warnings;
use diagnostics;


Let's take a closer look at your sub.

: sub f1 {
:
:  my ($a) =@_;
:  $cp=1;
:    $LOCAL_CODEPAGE =10;

     Why use $a as a lexical variable and not $cp or
$LOCAL_CODEPAGE?


:  if ($a==1){
: 	 $LOCAL_CODEPAGE = $cp;
: 	 break;

     There is no break() function in perl. I am unsure what
you were intending here. You can exit a sub at any time
with return(). It need not be only at the end. You can
find all the perl built-in functions in 'perlfunc' in the
perl docs.


:  }
:  return $LOCAL_CODEPAGE = $a;

     You are not passing out what you think you are passing
out. Returning an assignment will return its result, not the
value of its variables.

     So, "return $a;" will return the value in $a, but
returning "$foo = $a" will return 1 if the assignment to
$foo succeeded and 0 if it did not.


HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328

#22795 From: "Ken Shail" <ken@...>
Date: Thu Feb 9, 2006 8:50 am
Subject: Re: [PBML] How do you send a variable to another script?
kenshail2003
Send Email Send Email
 
Have you thought about having server B listen on a separate port and then
get sever A to open a simple socket to send the new data.

----- Original Message -----
From: saeph69 ; saeph69
To: perl-beginner@yahoogroups.com
Sent: Wednesday, February 08, 2006 11:21 PM
Subject: [PBML] How do you send a variable to another script?


Hi everyone,

First time posting here, so please be gentle:)  I have posted this
question in another forum but wasn't able to get the answer I was
looking for.  So my apologies in advance for the cross-post.  Here is
what I am trying to do:

I have a dynamically generated list of widget names on Server A. I
have a realtime logfile of all the widget historical activities for
the past X months on Server B. When my client clicks on a widget name,
I need to be able to send the widget name to Server B as a variable so
a second script on Server B can parse and process that name against
the historical log.

I have been able to do this when I use a form and the 'POST' method.
For security reasons, I cannot pass these in the URL using the 'GET'
method. What are my options, other than using a form, to pass a
variable from one script to another, both residing on separate
servers? Both servers reside on the same network in an intranet
environment.

Thanks in advance for your help.






Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html



SPONSORED LINKS Basic programming language C programming language Computer
programming languages
The c programming language C programming language List of programming
languages



YAHOO! GROUPS LINKS

  Visit your group "perl-beginner" on the web.

  To unsubscribe from this group, send an email to:
  perl-beginner-unsubscribe@yahoogroups.com

  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

#22796 From: "Ken Shail" <ken@...>
Date: Thu Feb 9, 2006 8:52 am
Subject: Re: [PBML] How do you send a variable to another script?
kenshail2003
Send Email Send Email
 
Have you thought about having server BE listen on a separate port and then
get sever A to open a simple socket to send the new data.

   ----- Original Message -----
   From: saeph69 ; saeph69
   To: perl-beginner@yahoogroups.com
   Sent: Wednesday, February 08, 2006 11:21 PM
   Subject: [PBML] How do you send a variable to another script?


   Hi everyone,

   First time posting here, so please be gentle:)  I have posted this
   question in another forum but wasn't able to get the answer I was
   looking for.  So my apologies in advance for the cross-post.  Here is
   what I am trying to do:

   I have a dynamically generated list of widget names on Server A. I
   have a realtime logfile of all the widget historical activities for
   the past X months on Server B. When my client clicks on a widget name,
   I need to be able to send the widget name to Server B as a variable so
   a second script on Server B can parse and process that name against
   the historical log.

   I have been able to do this when I use a form and the 'POST' method.
   For security reasons, I cannot pass these in the URL using the 'GET'
   method. What are my options, other than using a form, to pass a
   variable from one script to another, both residing on separate
   servers? Both servers reside on the same network in an intranet
   environment.

   Thanks in advance for your help.






   Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html



   SPONSORED LINKS Basic programming language  C programming language  Computer
programming languages
         The c programming language  C programming language  List of programming
languages


------------------------------------------------------------------------------
   YAHOO! GROUPS LINKS

     a..  Visit your group "perl-beginner" on the web.

     b..  To unsubscribe from this group, send an email to:
      perl-beginner-unsubscribe@yahoogroups.com

     c..  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


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



[Non-text portions of this message have been removed]

#22797 From: "mirza2288" <mirza2288@...>
Date: Thu Feb 9, 2006 9:43 am
Subject: Question
mirza2288
Send Email Send Email
 
Dear Friends,

Please kindly reply my Questions -

1. What is a Unix
2. What is a Unix Shell acoount to run PERL.

Please friends, reply urgently

I will thnkful to u.

-Ali

#22798 From: Mike Southern <gb1198@...>
Date: Thu Feb 9, 2006 11:36 am
Subject: Re: [PBML] Optimal way to parse an IP address
mikesouthern
Send Email Send Email
 
Besides which, I have 120 "127.1" address components in 120 different LANs.
So the last time *I* saw this address was yesterday.


On 2/8/06 9:06 PM, merlyn@... at merlyn@... wrote:

> Jenda> What was the last time you've seen something like this used as an IP
> Jenda> address.
>
> That is so *completely* not the point.
>
> If you say "this regex validates legal IP addresses", it better damn well
> follow the spec.  If you say "this regex validates legal email addresses",
> it better damn well follow the spec.
>
> If you say "this regex validates most of the IP addresses I've seen",
> you can get away with sloppiness.
>
> But that wasn't what was said.

#22799 From: "Wittich,Douglas G" <DWITTICH@...>
Date: Thu Feb 9, 2006 1:29 pm
Subject: RE: [PBML] Question
n3vej
Send Email Send Email
 
http://www.unix.com/

Unix is an operating system.  It makes the computer hardware function so
it can run your applications.   Unix can serve many more users and
larger machines than Windows can (generally speaking, not trying to
start a flame war).

A Unix Shell account is your login account so you can have an
interactive session.  The shell is normally called SH or KSH.   Look at
the link above, and read the forums. A lot.

doug



	 Sent: Thursday, February 09, 2006 4:43 AM
	 To: perl-beginner@yahoogroups.com
	 Subject: [PBML] Question


	 Dear Friends,

	 Please kindly reply my Questions -

	 1. What is a Unix
	 2. What is a Unix Shell acoount to run PERL.

	 Please friends, reply urgently

	 I will thnkful to u.

	 -Ali





==============================================================================
This communication, together with any attachments hereto or links contained
herein, is for the sole use of the intended recipient(s) and may contain
information that is confidential or legally protected. If you are not the
intended recipient, you are hereby notified that any review, disclosure,
copying, dissemination, distribution or use of this communication is STRICTLY
PROHIBITED.  If you have received this communication in error, please notify the
sender immediately by return e-mail message and delete the original and all
copies of the communication, along with any attachments hereto or links herein,
from your system.

==============================================================================
The St. Paul Travelers e-mail system made this annotation on 02/09/06, 08:29:34.



[Non-text portions of this message have been removed]

#22800 From: "Charles K. Clarkson" <cclarkson@...>
Date: Thu Feb 9, 2006 4:22 pm
Subject: RE: [PBML] Question
charlesclarkson
Send Email Send Email
 
mirza2288 wrote:

: 1. What is a Unix

  http://www.google.com/search?as_epq=what+is+unix


: 2. What is a Unix Shell acoount to run PERL.


  http://www.google.com/search?as_epq=What+is+a+Unix+Shell+account


HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328

Messages 22771 - 22800 of 27459   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help