[25360] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7605 Volume: 10

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

Date: Tue, 4 Jan 2005 21:05:17 -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           Tue, 4 Jan 2005     Volume: 10 Number: 7605

Today's topics:
    Re: Can't locate <module> in @INC - but I can see modul (Jay Tilton)
    Re: cross-platform shell scripts <jurgenex@hotmail.com>
    Re: cross-platform shell scripts <jurgenex@hotmail.com>
    Re: cross-platform shell scripts <see_sig@invalid>
    Re: Dummy regex question <not@home.net>
    Re: FAQ 1.4: What are perl4 and perl5? <matthew.garrish@sympatico.ca>
    Re: FAQ 1.4: What are perl4 and perl5? <uri@stemsystems.com>
    Re: file rename help <spedwards@x.qwest.net>
    Re: file rename help <spedwards@x.qwest.net>
    Re: file rename help <spedwards@x.qwest.net>
    Re: Is zero even or odd? <cool_blue_dog@nospam_hotmail.com>
    Re: LWP::Simple getstore not working inside of hash :( <jkeen_via_google@yahoo.com>
    Re: Newbie question: "Get substring of line" <matthew.garrish@sympatico.ca>
    Re: Newbie question: "Get substring of line" <tadmc@augustmail.com>
        NEWBIE: Perl CGI script that redirects to another webpa <SPAM FREE WORLD>
    Re: NEWBIE: Perl CGI script that redirects to another w <matthew.garrish@sympatico.ca>
    Re: Perl and TeX <dak@gnu.org>
    Re: Program optimisation advice for newbie <wolf_gore@yahoo.com.au>
    Re: Searching perl script which calls web page and forw <rccharles@my-deja.com>
    Re: Searching perl script which calls web page and forw <see_sig@invalid>
        ssl login to ebay <peter.c.dietrich@freenet.de>
    Re: ssl login to ebay <see_sig@invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 05 Jan 2005 04:25:01 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Can't locate <module> in @INC - but I can see module is there!
Message-Id: <41db6b4b.18100096@news.erols.com>

Ken <x3v0-usenet@yahoo.com> wrote:

: Justin Wyllie wrote:
: > I'm running a program sa-learn that comes with SpamAssassin anti-spam s/w.
: > 
: > This script fails on this line:
: > 
: > require Mail::SpamAssassin::CmdLearn;
: > 
: > with a message saying the module can't be found in @INC. The print-out for
: > @INC includes:
: 
: Any reason you are using a 'require' instead of 'use'? I think 'use' 
: would probably solve your problem.

What misapprehension causes you to believe "use" can locate a file that
"require" cannot?



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

Date: Wed, 05 Jan 2005 00:18:13 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: cross-platform shell scripts
Message-Id: <9nGCd.25590$2X6.1207@trnddc07>

Mitja wrote:
> On Tue, 04 Jan 2005 16:07:46 GMT, Jürgen Exner <jurgenex@hotmail.com>
> wrote:
>
>> Claudio wrote:
>>> I would like to use it for creating cross-platform shell scripts
>>> (Windows and Unix ).
>>
>> Well, do you know for certain that your Windows users installed a
>> shell (e.g. tsch, bash, or whatever) on their boxes?
>
> Windows user _do_ have a shell installed. It's called explorer.exe.

You may want to check your references.
Explorer.exe is a web browser (with some added functionality). I certainly 
wouldn't consider it a "shell".
Actually, which script language to you use to for a shell script, that runs 
on explorer.exe?

Maybe you meant cmd.exe or command.com?

> The shell is an integral part of every OS, that's why it's called the
> way it is. It encloses the inner workings of the OS and provides an
> interface for users.
>
> From dictionary.com:
> The command interpreter used to pass
> commands to an operating system; so called because it is the
> part of the operating system that interfaces with the outside
> world.

How does explorer.exe interface between the inner workings of the OS and the 
outside world?

>>> I suppose Perl is appropriate for this task.
>> Somewhere you lost me. Where would you use _Perl_ for writing _shell_
>> scripts?
> Sure, perl programs that interact with the shell, be it bash, cmd or
> anything else. He most probably wants to create file manipulation
> scripts independent of the OS, using Perl as THE layer taking care of
> most problems and OS differences.

Ok, that of course is a totally different question. And obvoiously Perl is 
well suited for such a task because it is inherently portable.

jue 




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

Date: Wed, 05 Jan 2005 00:31:40 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: cross-platform shell scripts
Message-Id: <MzGCd.25986$tG3.15965@trnddc02>

Claudio wrote:
> Said in another way, I would like to write Perl programs instead of
> Unix shell scripts and Windows batch files.

Ah, ok, that makes much more sense.

> Of course I am not talking about language constructs, I'm talking
> about modules that implement portable libraries to emulate the usual
> tasks that you do in shell scripts.

Usually not necessary because Perl programs are inherently portable unless 
you deliberately make them non-portable.
Some things to watch out for:
- don't use external programs, i.e. don't use system(), backticks, qx//, 
 .... Chances are that external programs don't exist on other platforms. 
Luckily most task which in shell require an external tool can be done 
directly in native Perl without any problem
- use a forward slash as directory separator, not a backslash. While you can 
use either one on WIndows Unix doesn't like the backslash.
- use the smallest common denominator for file names, i.e. Unix allows more 
characters in file names than Windows. So use Windows restrictions.
- don't use absolute paths because the root in Unix and the root in Windows 
are different.

> Using your context, I didn't ask whether Pascal is good for writing

Who is "you"? I'm guessing you are replying to my answer, but please follow 
standard customs and quote those text pieces which you are refering to.

> COBOL programs, I asked whether there are Pascal libraries that could
> simplify my job of writing programs to deal with fixed-length
> records...

Well, to make the connection back to rewriting shell scripts in Perl: You 
may consider Perl to be  a much enhanced superset of shell scripting and 
usually there is no need for any additional library to emulate shell script 
behaviour. Even more, many of the tasks, which require forking of an 
external program in shell, can be done more easily in native Perl.

jue 




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

Date: Tue, 04 Jan 2005 22:47:04 -0500
From: Bob Walton <see_sig@invalid>
Subject: Re: cross-platform shell scripts
Message-Id: <41db628a$1_1@127.0.0.1>

Claudio wrote:

 ...
> I would like to use it for creating cross-platform shell scripts
> (Windows and Unix ).
> I suppose Perl is appropriate for this task.
> Should I look at any module in particular?
 ...
> -Claudio 

Maybe you want Perl Power Tools:  http://ppt.perl.org

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


----== 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, 05 Jan 2005 04:33:57 GMT
From: "JayEs" <not@home.net>
Subject: Re: Dummy regex question
Message-Id: <V6KCd.7186$F67.783@newssvr12.news.prodigy.com>

> The function you want is called split.

I tried:

@array = split(/ /,$test);

But when I test with:

print $array[0];

 ...it contains the entire $test and $array[1] is undef. I checked the part 
of html that I am parsing and it looks like "$&nbsp;12.25" in the HTML 
fragment, but when I do:

print $test;

 ...it shows me: "$ 12.25"

Is there something special I need to do to handle the &nbsp; ?

HELP!! 




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

Date: Tue, 4 Jan 2005 18:52:03 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: FAQ 1.4: What are perl4 and perl5?
Message-Id: <B_FCd.7522$7n1.575402@news20.bellglobal.com>


"brian d foy" <comdog@panix.com> wrote in message 
news:040120050606407285%comdog@panix.com...
> In article <Xns95D47575A0A9ebohlmanomsdevcom@130.133.1.4>, Eric Bohlman
> <ebohlman@omsdev.com> wrote:
>
>> PerlFAQ Server <comdog@panix.com> wrote in
>> news:crbts5$2bt$1@reader1.panix.com:
>>
>> > 1.4: What are perl4 and perl5?
>
>> Does this still belong in the FAQ as of 2005?  The only reason I can 
>> think
>> of is poorly-written books with "Perl 5" in the title (are any of them
>> still in print?).
>
> it probably doesn't belong.  I'll see about removing it.
>

Or how about replacing it with:

How to spot Perl4 code

a) You found it at www.scriptarchive.com/

b) It has lots of funky &function(); calls

c) ...

Matt 




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

Date: Wed, 05 Jan 2005 03:28:11 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: FAQ 1.4: What are perl4 and perl5?
Message-Id: <x7llb8tv05.fsf@mail.sysarch.com>

>>>>> "bdf" == brian d foy <comdog@panix.com> writes:

  bdf> In article <040120050606407285%comdog@panix.com>, brian d foy
  bdf> <comdog@panix.com> wrote:

  >> In article <Xns95D47575A0A9ebohlmanomsdevcom@130.133.1.4>, Eric Bohlman
  >> <ebohlman@omsdev.com> wrote:

  >> > PerlFAQ Server <comdog@panix.com> wrote in
  >> > news:crbts5$2bt$1@reader1.panix.com: 

  >> > > 1.4: What are perl4 and perl5?

  >> > Does this still belong in the FAQ as of 2005?  The only reason I can think 
  >> > of is poorly-written books with "Perl 5" in the title (are any of them 
  >> > still in print?).

  >> it probably doesn't belong.  I'll see about removing it.

  bdf> Actually, maybe we should morph into "What are perl4, perl5, and
  bdf> perl6?" :)

so then why not cover perl1 which has recently been updated to actually
build on modern systems. :)

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: Tue, 4 Jan 2005 17:43:29 -0700
From: "Shawn" <spedwards@x.qwest.net>
Subject: Re: file rename help
Message-Id: <ZKGCd.29$HO2.2076@news.uswest.net>

Of course, thank you for your time and input.  This is allot of info to take 
in.

The warnings have been a great help.  That along with a better understanding
of the usage of system.  I think as Michele pointed out in another post the 
separation
of the shell script and a Perl program is a obvious struggle that I have had 
separating.
Another point that Andrew mentioned is this script is just the beginning and 
building
to something bigger.  Therefore the usage of the Mime and others.


"Andrew Hamm" <ahamm@mail.com> wrote in message 
news:340liqF43djv0U1@individual.net...
> Michele Dondi wrote:
>>
>>> ## no warnings 'uninitialized';
>>>
>> Indeed that is the single warning that most often needs to be disabled
>> out of good reason. But since it can still be useful, it should be
>> really disabled *locally* only in those situations in which you know
>> you could get it but you know you do not want to be warned as you
>> expected it.
>
> I've done a lot of SQL/4GL where (sql's)NULL is a very natural variable,
> and also from C where I was a fan of exploiting the equivalence of
> NULL/0/truth in conditionals, so if I screw up and needed "warnings
> uninitialized" I would consider myself ready for the nursing home :-) I
> think it's a mistake akin to adding to customer names together and
> expecting their account balance to pop out.
>
> But, Shawn's experience shows that this warning is indeed valuable for a
> lot of people. It would not have directly explained his problem, but it
> could have made him think about a line of code that was failing.
>
>> Incidentally had I known you (and others, now I see) wrote this
>> followup, probably I would have not written mine. However the OP's
>> script is so full of bizarre constructs that I've not paid extreme
>> attention to each single one of them and so he will probably benefit
>> from many people supplying their own cm
>
> yeah - the more the merrier. And everyone has been fairly nice too. Just
> waiting for Shawn to say "thanks" to everyone ;-)
>
>
> 




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

Date: Tue, 4 Jan 2005 17:49:40 -0700
From: "Shawn" <spedwards@x.qwest.net>
Subject: Re: file rename help
Message-Id: <MQGCd.30$HO2.1827@news.uswest.net>


>
> Oh yes - I can see where the "insufficient arguments" is coming from, and
> it is indeed coming from mv. The string you are passing to system is
> effectively
>
>     /bin/mv f01234\n f01234\n.zero.txt"
>
> so that's three lines of shell script:
>
> /bin/mv f01234
> f01234
> .zero.txt
>
> Clearly wrong. If you had  used chomp to clean up the filename then the
> system( ) call would have worked without errors.
>

The output from the system call just wasn't something I had put into 
consideration.
I obviously needed a better understanding of the system call for its usage. 




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

Date: Tue, 4 Jan 2005 18:06:14 -0700
From: "Shawn" <spedwards@x.qwest.net>
Subject: Re: file rename help
Message-Id: <i4HCd.31$HO2.2079@news.uswest.net>

> So in this case...
>
>>        while ($cfile = <FILE_LIST>) {
>
> ...I'd use
>
>  for (grep !/txt/, <f*>) {
>

I will give this a try.  Just trying to find all files that start with a f 
and don't have a txt extention.

> instead.
>
>>                if ( -z "$cfile" ) {
>>                        system("/bin/mv $cfile $cfile.zero.txt");
>
> You can use Perl's rename() here. (File::Copy can be preferrable in
> some situations).
>
>>                $charcount = system("cut -c9 $cfile |sort -u |grep '/'
>>|wc -l");
>
> You do not want system() here: you want qx// instead, aka backticks
> (but I don't like them! ;-)
>
> Also, what if $cfile was empty and hence moved to "$cfile.zero.txt"?!?
>
> However what you wrote above takes the 9th char from each line of
> $cfile and sorts with -u, so that you either get exactly one or zero
> line(s) with '/' (or better: being exactly '/') according to wether
> there's at least one line with '/' in 9th position or not. Or am I
> mistaken?
>

The purpose of the attempt to check if the 9th character is the '/', is 
because it identifies the
file as belonging to one set of files or another.  I think another post 
pointed out a error that
is true.  Instead of reading the entire file the first line should suffice. 
If its not in the first line
then its not in the file at all.

> Perl code for the above _could_ be:
>
>  open my $fh, '<', $cfile or
>    die "Can't open `$cfile': $!\n";
>  my $charcount=0;
>  while (<$fh>) {
>      $charcount=1 and last if m|(?<=^.{8})/|;
>  }
>
> (but I guess you really wanted something else!)
>
>>                if ( $charcount > 0 ) {
>
> You can use
>
>  if ($charcount) {
>
> instead.
>
>>                        chomp($csv_client_id = `cut -c1-6 $cfile 
>> |sort -u`);
>
> Perl's own code for this _could_ be:
>
>  open my $fh, '<', $cfile or
>    die "Can't open `$cfile': $!\n";
>  my %saw;
>  @csv_client_ids = grep !$saw{$_}++,
>    map { chomp; substr $_, 0, 6 } <$fh>;
>
> Please note that I used an array instead of what you wrote because I
> _think_ that what you wrote in the first place is not what you really
> want.
>
> Of course, since you read the contents of $cfile twice, then you'd
> better open() it once and the either slurp it into an array all at
> once (and then process it separately) if the file is small enough or
> use two separate C<while> loops seek()ing in between them.
>

Again I didn't even consider that fact that I was opening the stinking file 
twice.

> I think that it would be better for you to provide a description of
> the task you're aiming at (or a suitably simplified version of it) and
> we may hopefully provide a minimal hopefully working example script.

Here is the task.  I receive file(s) from business partners which come in 3 
formats:
    #1 - empty file and name it so
    #2 - a file that contains '/' in the 9th position of the line and 
therefore I need to
            extract characters 1-6 and should use in the filename ex: 
$cfile.chars1-6.txt (I hadn't gotten that far)
            this is where the csv_client_ids was coming from.  So, I was 
just simplfying the
            naming to $cfile.char.txt or $cfile.nochar.txt.
    #3 - a file that doesn't contain the '/' in the 9th position and 
therefore the extract characters
            1-13 and use them in the file name $cfile.chars1-13.txt

It could be 1 file or up to 200 files at a time.  Ultimately, this would 
lead to emailing certain people
when different files are received.  Plus, leaving it flexible enough should 
a 4th or 5th format started coming.

Thanks,
Shawn 




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

Date: Tue, 4 Jan 2005 18:18:15 -0800
From: "crzndog" <cool_blue_dog@nospam_hotmail.com>
Subject: Re: Is zero even or odd?
Message-Id: <HfKdnWTm2-MV00bcRVn-uA@comcast.com>

Maybe it's nothing!

"Andrew Hamm" <ahamm@mail.com> wrote in message 
news:340lisF43djv0U2@individual.net...
> Androcles wrote:
>>
>> When I was test engineering for flight simulators, the DC9 sits
>>[SNIP]
>
> fascinating!
>
>
> 




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

Date: Tue, 04 Jan 2005 23:26:22 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: LWP::Simple getstore not working inside of hash :(
Message-Id: <yCFCd.22144$fe5.13629@trndny06>

Perl Mon wrote:
> I have a question.  I am a perl newbie, but I like it a lot so far.  I
> can get this little Perl file to work as a stand alone perl program:
> 
> #!/usr/bin/perl
> use strict;
> use warnings;

Good so far!

> use LWP::Simple;
> 
> my $TINI_IP = 'http://192.168.1.6';
> 
> my $TiniWeather_LocalHTML_location = 'C:/Program
> Files/SlimServer/server/TiniWeatherLocalHTML.txt';
>

errr ... Couldn't you shorten the name of that variable?  Such a long 
name courts typing errors.

> LWP::Simple::getstore($TINI_IP,$TiniWeather_LocalHTML_location) or die
> "Copy failed: $!";
> 
> But, if I try and insert that code under the my functions hash below in
> another program, I can't get it to work.  I have worked about 8 hours
> on this (incuding reading tons off of the Internet).  I was wondering
> if anyone had any ideas.  Any help would be greatly appreciated.
> 
> I have the same use statment in the program that this snippet comes
> from as above.
> 
> ************ start code snippet here *********************
> 
> my %functions = (
> 'left' => sub {
> Slim::Buttons::Common::popModeRight(shift);
> },
> 'up' => sub {

Are we supposed to know what this Slim::Buttons ... module is?  It's 
clearly not on CPAN.

Jim Keenan


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

Date: Tue, 4 Jan 2005 19:58:34 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Newbie question: "Get substring of line"
Message-Id: <XYGCd.7572$7n1.598004@news20.bellglobal.com>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:7urkt0lmmf93nkbdspfkci6tsh0asbt7rh@4ax.com...
> On Tue, 04 Jan 2005 09:09:43 +0100, Petterson Mikael
> <mikael.petterson@ericsson.se> wrote:
>
>>Lines looks like this:
>>
>>xdt=a2a
>>zdt=b2b
>>....
>>
>>Is there a simple way in perl to assign a $str the substring after the
>>equal sign?
>
>  (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) = /[^=]+=(.*)/;

Matt 




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

Date: Tue, 4 Jan 2005 15:36:13 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Newbie question: "Get substring of line"
Message-Id: <slrnctm32d.43a.tadmc@magna.augustmail.com>

Uri Guttman <uri@stemsystems.com> wrote:

> and my horse is only a pony so it isn't that high. :)


Keep a careful eye on what type of "grass" it is eating...


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


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

Date: Tue, 4 Jan 2005 23:40:54 -0000
From: "Tester" <SPAM FREE WORLD>
Subject: NEWBIE: Perl CGI script that redirects to another webpage
Message-Id: <41db2985$1@news1.homechoice.co.uk>

Hi There,

I think this is very simple. I need to write a PERL script that a form is
submitted to it, one of the forms input parameters is a URL.

Once the script has done some other processing, it redirects the users
browser to the URL.

E.g.
Webpage is Form submission.
User presses submit and it sends over form details including one (hidden)
field called URL
PERL script processes the form and then redirects browser to the URL field

I hope that makes sense and I am sure that is easy to do but I am not sure
how.

Kind regards and thanks in advance.

Dave




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

Date: Tue, 4 Jan 2005 18:59:24 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: NEWBIE: Perl CGI script that redirects to another webpage
Message-Id: <t5GCd.7528$7n1.578179@news20.bellglobal.com>


"Tester" <SPAM FREE WORLD> wrote in message 
news:41db2985$1@news1.homechoice.co.uk...
> Hi There,
>
> I think this is very simple. I need to write a PERL script that a form is
> submitted to it, one of the forms input parameters is a URL.
>
> Once the script has done some other processing, it redirects the users
> browser to the URL.
>

Please see the perlfaqs for why you should never write PERL.

I have no idea why you would pass the final url around in a hidden field, 
but the solution to your problem lies with the http header you send. Print 
the correct ***redirect*** to that url and all will be well...

Googling on "perl cgi redirect" will also show you that this question has 
been answered many, many times now.

Matt 




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

Date: Wed, 05 Jan 2005 01:34:27 +0100
From: David Kastrup <dak@gnu.org>
Subject: Re: Perl and TeX
Message-Id: <x51xd04sto.fsf@lola.goethe.zz>

Michele Dondi <bik.mido@tiscalinet.it> writes:

> On Thu, 30 Dec 2004 15:31:46 +0100, David Kastrup <dak@gnu.org> wrote:
>
>>>>Shrug.  There is no particular advantage making Perl particularly
>>>
>>> Well it's well suited for text processing.
>>
>>TeX's input processing has very little to with standard text
>>processing, and in fact I don't see any advantage Perl would offer
>>here.  You could probably use Perl's hash tables for control
>>sequences, but that's pretty much all.  The table of equivalents does
>>not map comfortably to anything Perl would offer.
>
> Perl parsing already is "a little" different than standard text
> processing.

Well, a chainsaw is quite different from a screwdriver, but that still
does not make it the right tool to drive nails.

Please state _any_ part of implementing TeX where Perl would offer a
significant advantage over hard-coded stuff.  And no, the simple
parsing rules of TeX really don't look relevant here.

> Perl6 will go so far that the parser will be radically modifiable at
> compile time. Pardon me if I'm wrong, but this (and other
> charachteristics) will make it much more similar to TeX than
> anything else I can think of...

We are not talking about producing similar problems, we are talking
about _solving_ the same problems.  And I don't see why Perl would
help here, and you don't have specified _anything_ of more than
superficial value.

>>> course TeX is a whole another thing.  This is why I thought of
>>> Perl6.
>>
>>So what would Perl6 offer that would be less painful than just
>>explicit coding in some more efficient language?
>
> Grammars!

So what do you intend to use them for?

> Regular expressions are already not really much regular any more,
> but they will be made so powerful and different from the current
> behaviour that their name will be changed to "rules". Not only! Just
> like (in some sense) classes group methods, a new concept will be
> introduced: that of a grammar, such that grammars will group rules
> and incidentally this will be much more than a passing similarity.

So what would Perl6 offer for TeX and its ilk that would be less
painful that just explicit coding in some more efficient language?

Please don't just deliver buzzwords, but a concrete implementation
problem that you can solve for TeX.

>>>>suited to Perl, the stuff Perl offers for parsing and scanning is
>>>>not well-suited for TeX, the main control structures and concepts
>>>>in TeX (optimization and parallel execution, which are mostly
>>>>hard-coded in current TeX) don't map well to Perl and would still
>>>>require mostly hard-coding.
>
> I would like to hear someone else's opinion about this.

How about your own?  Pick any nontrivial part from "TeX, the Program"
or a useful significant extension for it and develop an argument why
this particular part would be much more naturally expressed, coded and
managed in Perl6.  By sketching the outline in Perl6 as opposed to
Pascal.

>>> So what? Perl already supports binary extensions. Rumors have it
>>> that creating such extensions will be much easier under Perl6.
>>
>>So where is _any_ advantage?
>
> That if you're concerned about Perl's ability to cope with certain
> tasks you can rely on the possibility of writing the problematic
> code in some other language you consider to be more well suited to
> it.

C interfaces with everything, too.  I don't need Perl6 for that.

>>>>In short: there is nothing that would particularly recommend Perl.
>>>
>>> Certainly it would be better suited than other languages.
>>
>>That is a blanket statement for which I see no support at all.  You
>>have not pointed out anything in which Perl would offer something of
>>particular value for TeX programming.
>
> I hope I have done so above...

I don't see where.  You are giving a few buzzwords about some areas
which you think might be relevant to TeX, but don't point out why and
where.

> Have you seen much from Perl6 for TeX-like tasks?!?
>
> This is a whole another matter, however: believe me!

You are free to code parts of TeX in Perl6 (like the TeX parser) to
demonstrate the superiority of it for this task.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>


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

Date: 4 Jan 2005 15:14:04 -0800
From: "ChocMonk" <wolf_gore@yahoo.com.au>
Subject: Re: Program optimisation advice for newbie
Message-Id: <1104880443.969046.201050@z14g2000cwz.googlegroups.com>


John W. Krahn wrote:
> This should do what you want:
>
> $ perl -MData::Dumper -le'
> my $descr = q(
> asdasdasd@@\main\3
> boohoo@@\main\6
> toodle@@\main\9);
>
> my %names = $descr =~ / ( .+? ) \@\@ ( .+ ) /xg;
>
> print Dumper \%names;
> '
> $VAR1 = {
>            'asdasdasd' => '\\main\\3',
>            'toodle' => '\\main\\9',
>            'boohoo' => '\\main\\6'
>          };
>
>
>
> John
> --
> use Perl;
> program
> fulfillment

And it does! John's solution floats my boat. Thanks Alan, Tad, Michele.
This was my very first post here and I'm amazed by the response. Much
appreciated, a better way to learn and improve than just using a book.



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

Date: Tue, 04 Jan 2005 23:39:19 -0500
From: Robert <rccharles@my-deja.com>
Subject: Re: Searching perl script which calls web page and forwards to me / displays with adjusted URLs
Message-Id: <rccharles-911FDD.23391804012005@individual.net>

In article <creret$vvp$03$1@news.t-online.com>,
 tom.parson@gm.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.

Perhaps you could set up a proxy server on your server and configure 
your browser to use this proxy server?  This is a guess on my part, but 
seems like the kind of thing a proxy server does.  Isn't a proxy server 
built into apache?

When your company figures out that you have gotten around the firewall, 
I do not see them as being happy.

Robert


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

Date: Tue, 04 Jan 2005 22:39:38 -0500
From: Bob Walton <see_sig@invalid>
Subject: Re: Searching perl script which calls web page and forwards to me / displays with adjusted URLs
Message-Id: <41db60cd$1_1@127.0.0.1>

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
> 

UNTESTED:

#!/usr/local/bin/perl
use CGI qw(:standard);
use LWP::Simple;
use warnings;
use strict;
print header,getprint(param('url'));

coupled, of course, with an HTML page with a form containing a 
text field named "url" and a submit button.

Heed the warnings others have given about doing this.
-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


----== 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 01:09:10 +0100
From: "Peter Dietrich" <peter.c.dietrich@freenet.de>
Subject: ssl login to ebay
Message-Id: <crfb71$ugi$04$1@news.t-online.com>

Hello everyone,

I would like to write a Perl script, that does a login to ebay. I have
searched the internet and newsgroup archives, but all I have found are bits
of information pertaining to the login-process without ssl or methods that
insert username and password directly into a url.
I have already written a few lines but am no at a point, where I don't know
what to do next.
The problem is that I have no information about the detailed authentication
process. I know it involves cookies. But neither do I know whether to send
cookies ebay left in the jar nor do I know how, where and when to send them.
This is as far as I have come (actually not that far):

    #!usr/bin/perl
    use warnings;
    use strict;
    use LWP::UserAgent;
    use HTML::Form;
    use HTTP::Cookies;
    my $browser = LWP::UserAgent->new(agent=>"Mozilla/8.0");
    $browser->cookie_jar(HTTP::Cookies->new(file => "cookies.txt"));
    my $site =
$browser->get("http://my.ebay.de/ws/eBayISAPI.dll?MyeBay&amp;ssPageName=h:h:mebay:DE");
# openssl and crypt::ssleay are installed
    open FH, ">ebay.htm";
    my @form = HTML::Form->parse($site);
    my $input=$form[1]->inputs;
    my $id = $form[1]->find_input("userid");
    my $password = $form[1]->find_input("pass","password");
    my $button = $form[1]->find_input("signinButton","submit");
    $id->value("username");
    $password->value("password");
    my $request=$button->click($form[1]);
    #print ("As_String: ",$request->as_string,"\n");
    print FH $browser->post($request->uri)->as_string;  # get or post?
    close FH;

Does this even point to the right direction?
It would be very nice if someone could give me advice on how this can be
done.

Thanks in advance,

Peter Dietrich

Note: I have also posted this on comp.lang.perl.moderated, but the message 
has not appeared there for two days now. 




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

Date: Tue, 04 Jan 2005 22:25:43 -0500
From: Bob Walton <see_sig@invalid>
Subject: Re: ssl login to ebay
Message-Id: <41db5d89$1_4@127.0.0.1>

Peter Dietrich wrote:

> Hello everyone,
> 
> I would like to write a Perl script, that does a login to ebay. I have
> searched the internet and newsgroup archives, but all I have found are bits
> of information pertaining to the login-process without ssl or methods that
> insert username and password directly into a url.
> I have already written a few lines but am no at a point, where I don't know
> what to do next.
> The problem is that I have no information about the detailed authentication
> process. I know it involves cookies. But neither do I know whether to send
> cookies ebay left in the jar nor do I know how, where and when to send them.

I recommend you read:

   perldoc lwpcook

particularly the sections "Access to Protected Documents" and 
"HTTPS".  Also:

   perldoc lwptut

particularly the sections "HTTP Authentication" and "Accessing 
HTTPS URLs".

I think you're probably on the wrong track with cookies.

If, after following the information above you still have 
questions, ask again.

 ...
> Peter Dietrich
 ...
-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


----== 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: 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 7605
***************************************


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