Re: DESTROY Issue

2004-05-27 Thread Lev Alexandrovsky
Hello!

Wednesday, May 26, 2004, 18:40:39, Dirk wrote:

 The global destruction starting earlier than destructor of this class.
 Try to undef class object before exit program.

DBN Lev is onto something here. When I place $Log = undef just before the exit
DBN in MovePDF, the filehandle exists in AmsLog and can be closed. Very
DBN interesting. While this is a solution, this is probably not the one that I
DBN will use as I would have to change every affected program. At this point in
DBN time, I have changed the LogClose method to check if the filehandle is
DBN defined prior to closing it.

DBN I wonder if anyone can shed some light on the timing of everything that
DBN happens at normal program termination concerning the de-allocation of
DBN objects, etc.

Some light from Camel book 3rd edition,
12.6.1. Garbage Collection with DESTROY Methods:
When an interpreter shuts down, all its objects are destroyed,
which is important for multithreaded or embedded Perl applications.
Objects are always destroyed in a separate pass before ordinary
references. This is to prevent DESTROY methods from using references
that have themselves been destroyed.

But something wrong in ActiveState Perl ;-((
Are objects destroyed earlier than references and filehandles?

I found two ways to avoid errors:
1. Rename DESTROY and manually call it like ordinary object method.
2. Objects must destroyed before global destruction (like above).

-- 
Best regards,
 Lev


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Editor - finding lines

2004-05-27 Thread Beckett Richard-qswi266
 I would think just a normal search feature would be good enough.
 Find the first one and then hit next for the next one etc.

That, IMO is the best feature of Crimson Editor... you can highlight something with 
the mouse, hit F3 and it takes you to the next instance of it, hit shiftF3 and it 
takes you to the previous one.

And for free, it's worth every penny ;-)

R.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Perl Tk

2004-05-27 Thread Beckett Richard-qswi266
It's not clear what you really want, but what about this...?

sub print_rec() {
   open (SAVE, c:/save/data.txt);
   @key = keys %info;
   foreach $_ (@key) { 
  print $_:$info{$_}\n;
  print SAVE $_:$info{$_}\n; 
   }
   close SAVE;
}   

R.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Eric Edwards
Sent: 27 May 2004 02:49
To: [EMAIL PROTECTED]
Subject: re:Perl Tk


Perl Tk Gurus,
I am studying Tk using Mastering Perl TK.  I found the below listed code in the book 
and got it working, 
 Added some stuff to it and it seems to be working OK.  I wanted to add  
$textundo-Save(?pathname?) 
so that it saves the contents of the widget to a file.  I want this to happen when
I click on the Save button.  I have tried several things but can't get it to work.  
Any help would be deeply appreciated.
The file path is C:/save.
Thanks,
Eric
#!/usr/bin/perl
use Tk;
$mw = MainWindow-new;
$mw-title(Text: Data Entry);
$f = $mw-Frame-pack(-side = 'bottom');
$f-Button(-text = Exit,
   -command = sub {exit;})-pack(-side = 'left');
$f-Button(-text = Save,
   -command = sub { print_rec; 
})-pack(-side = 'bottom');
$t = $mw-Scrolled(Text, -width = 40,
-wrap = 'none')-pack(-expand = 1, -fill = 'both');
foreach (qw/Name Address City State Zip Phone Occupation
   Company Business_Address Business_Phone/) {
   $w = $t-Label(-text = $_:, -relief = 'groove', -width = 20);
   $t-windowCreate('end', -window = $w);
   %info;
   $w = $t-Entry(-width = 20, -textvariable = \$info{$_});
   $t-windowCreate('end', -window = $w);
   $t-insert('end', \n);
}
#$t-configure(-state = 'disabled');  # disallows user typing
sub print_rec() {
   @key = keys %info;
   foreach $_ (@key) { 
  print $_:$info{$_}\n;   
   }
}   
MainLoop; 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Editor - finding lines

2004-05-27 Thread Dan Rawson
Ken Cornetet wrote:
 Was the mainframe editor XEDIT?
 
 If so, check out The Hessling Editor
 http://sourceforge.net/projects/hessling-editor/
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Valerie Kramer
 Sent: Wednesday, May 26, 2004 4:18 PM
 To: Perl-Win32-Users
 Subject: Editor - finding lines
 
 
 Since we're talking about editors (one more time!), I'd like to ask if
 anyone knows of a specific feature in any PC-based editors.
 
 Back in my IBM Mainframe programming days I used an editor that would
 search for a string and return a display of all of the lines containing
 that string. I could then edit the line(s) or go to one of them to
 perform edits on that area. (I don't remember the exact mechanics...
 it's been quite a few years now!)  I've often wished I had that tool on
 the PC and even bought a copy of SPF that I thought might do the job. I
 don't remember now if it did, but I do know I was very unsatisfied with
 it. perhaps if I'd become expert with it maybe it is ok, but I never
 managed to get comfortable with it. Does anyone know of another editor
 with a search feature similar to what I described?
 
 Valerie
 

Visual SlickEdit does this . . . but it aint cheap :-(


-- 
The information contained in this communication and any attachments is confidential 
and may be privileged, and is for the sole use of the intended recipient(s). Any 
unauthorized review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please notify the sender immediately by replying to this message 
and destroy all copies of this message and any attachments. ASML is neither liable for 
the proper and complete transmission of the information contained in this 
communication, nor for any delay in its receipt.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Editor - finding lines

2004-05-27 Thread Willem Hengeveld
On Thu, May 27, 2004 at 09:36:52AM +0100, Beckett Richard-qswi266 wrote:
  I would think just a normal search feature would be good enough.
  Find the first one and then hit next for the next one etc.
 
 That, IMO is the best feature of Crimson Editor... you can highlight
 something with the mouse, hit F3 and it takes you to the next instance
 of it, hit shiftF3 and it takes you to the previous one.

in vim you position the cursor over a word, and hit '*' to jump to the
next + highlite all matches.  'n'/'N' will move you to the next/previous
match.


I would like it even better though, sometimes I want to highlite several
items in different colors, like keeping multiple active searches, each
with a different highlite color.


 And for free, it's worth every penny ;-)

vim, even freeer.



one of my favorite vim features, is the ability to pipe a selected
portion ( or all ) of the text through an external program, and have
it replace by the output of this program.


when manipulating some piece of information, I often prefix it with
'__DATA__'  and a little bit of perl, starting with  'while (DATA)',
and then pipe the whole contents of my current window through perl, with
'!Gperl'
so I can easily experiment with the data while keeping it in my editor.


( always fun to have a 'my XYZ is better'-type discussion. )

willem

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Perl Tk

2004-05-27 Thread Eric Edwards
Beckett Richard replied:

It's not clear what you really want, but what about this...?

sub print_rec() {
   open (SAVE, c:/save/data.txt);
   @key = keys %info;
   foreach $_ (@key) { 
  print $_:$info{$_}\n;
  print SAVE $_:$info{$_}\n; 
   }
   close SAVE;
}   

R.
Richard,
This worked and did exactly what I wanted.  What I was 
trying to do was get an understanding of how to use and
Set up the $textundo-Save(?pathname?) method.  My book 
showed several of them but not how to set them up.
Thanks much for the info.
Eric

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Eric
Edwards
Sent: 27 May 2004 02:49
To: [EMAIL PROTECTED]
Subject: re:Perl Tk


Perl Tk Gurus,
I am studying Tk using Mastering Perl TK.  I found the below listed code
in the book and got it working, 
 Added some stuff to it and it seems to be working OK.  I wanted to add
$textundo-Save(?pathname?) 
so that it saves the contents of the widget to a file.  I want this to
happen when
I click on the Save button.  I have tried several things but can't get it
to work.  
Any help would be deeply appreciated.
The file path is C:/save.
Thanks,
Eric
#!/usr/bin/perl
use Tk;
$mw = MainWindow-new;
$mw-title(Text: Data Entry);
$f = $mw-Frame-pack(-side = 'bottom');
$f-Button(-text = Exit,
   -command = sub {exit;})-pack(-side = 'left');
$f-Button(-text = Save,
   -command = sub { print_rec; 
})-pack(-side = 'bottom');
$t = $mw-Scrolled(Text, -width = 40,
-wrap = 'none')-pack(-expand = 1, -fill =
'both');
foreach (qw/Name Address City State Zip Phone Occupation
   Company Business_Address Business_Phone/) {
   $w = $t-Label(-text = $_:, -relief = 'groove', -width =
20);
   $t-windowCreate('end', -window = $w);
   %info;
   $w = $t-Entry(-width = 20, -textvariable = \$info{$_});
   $t-windowCreate('end', -window = $w);
   $t-insert('end', \n);
}
#$t-configure(-state = 'disabled');  # disallows user typing
sub print_rec() {
   @key = keys %info;
   foreach $_ (@key) { 
  print $_:$info{$_}\n;   
   }
}   
MainLoop; 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Perl Tk

2004-05-27 Thread Eric Edwards
Jack D replied:
 
 I am studying Tk using Mastering Perl TK.  I found the below listed code
 in the book and got it working,
 
  Added some stuff to it and it seems to be working OK.  I wanted to add
 $textundo-Save(?pathname?)
 
 so that it saves the contents of the widget to a file.  I want this to
 happen when
 
 I click on the Save button.  I have tried several things but can't get
 it to work.
 
 Any help would be deeply appreciated.
 
 The file path is C:/save.

Well, if you want to use the Save method, then at a minimum you need to

use Tk::TextUndo;

I hope you are not expecting to be able to save the Entry widget data using
this method? If you wish to save that you will have to write your own
subroutine to get the input and save it separately.


 
 #!/usr/bin/perl
 
 use Tk;

 use Tk::TextUndo;

 $mw = MainWindow-new;
 $mw-title(Text: Data Entry);
 $f = $mw-Frame-pack(-side = 'bottom');
 $f-Button(-text = Exit,
-command = sub {exit;})-pack(-side = 'left');
 
 $f-Button(-text = Save,
-command = sub { print_rec;
 })-pack(-side = 'bottom');
 
 $t = $mw-Scrolled(Text, -width = 40,

   $t = $mw-Scrolled(TextUndo, -width = 40,
 -wrap = 'none')-pack(-expand = 1, -fill =
 'both');
 foreach (qw/Name Address City State Zip Phone Occupation
Company Business_Address Business_Phone/) {
$w = $t-Label(-text = $_:, -relief = 'groove', -width =
 20);
$t-windowCreate('end', -window = $w);
%info;
$w = $t-Entry(-width = 20, -textvariable = \$info{$_});
$t-windowCreate('end', -window = $w);
$t-insert('end', \n);
 }
 #$t-configure(-state = 'disabled');  # disallows user typing


 sub print_rec() {
@key = keys %info;
foreach $_ (@key) {
   print $_:$info{$_}\n;
}
 $t-Save(C:/save.txt);
 }
 
 MainLoop;
 

Jack

Jack,
What I was trying to do was get an understanding of how to use and
Set up the $textundo-Save(?pathname?) method.  My book 
showed several of them but not how to set them up.
Thanks much for the info.
Eric
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Editor - finding lines

2004-05-27 Thread Capacio, Paula J

Valerie Kramer wrote:
 ... used an editor that would search for a string
and return a display of all of the lines containing that string.
I could then edit the line(s) or go to one of them to perform edits
on that area. ...

TextPad has a search across all open documents, or all files 
in a directory.  The results are shown in a separate window and
double clicking the result takes you to that section of code in 
that file.  
Again like UltraEdit it's not free, but in the same price range.
It also has color syntax highlighting for perl and you can set up 
the tools to execute perl from within the editor.
http://www.textpad.com
Paula 


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Editor - finding lines

2004-05-27 Thread Dennis G. Wicks
On Thu, 27 May 2004, Beckett Richard-qswi266 wrote:

 Date: Thu, 27 May 2004 09:36:52 +0100
 From: Beckett Richard-qswi266 [EMAIL PROTECTED]
 To: Perl-Win32-Users [EMAIL PROTECTED]
 Subject: RE: Editor - finding lines

  I would think just a normal search feature would be good enough.
  Find the first one and then hit next for the next one etc.

 That, IMO is the best feature of Crimson Editor... you can highlight
  something with the mouse, hit F3 and it takes you to the next
  instance of it, hit shiftF3 and it takes you to the previous one.

 And for free, it's worth every penny ;-)

 R.

Greetings;

Yes, Crimson is very good. I have it installed on all (8) of
the computers I use.

But, if you have ever used XEdit/THE you would not consider
a normal search feature to be anywhere near good enough.

The feature in XEdit displays only the lines/records
containing the search string. Similar to layers in an image
editor or a DTP program. So, if you can display 80 lines in
your window you will see 80 lines that contain your search
string, not just 80 lines, one or two of which contain it.
Scrolling continues to show only lines containing the search
string.

ob: perl,

Suppose you need to find all the places where child is
called and in what subroutines it may be in. The command
would be

all /child(/|(/sub // {/)

and you would be viewing all subroutine headers and all
calls to child in the correct order, and only those lines.


Xedit was developed back in the '80s and was a big hit when
it came out. Previously there was only a line editor. It is
just unfortunate that other full-screen editors didn't
incorporate some of its features.

Get THE and check it out. It is very customizable and may
give you some ideas if you decide to write an editor of
your own!

Good Luck!
Dennis
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Editor - finding lines

2004-05-27 Thread Lee Goddard
Capacio, Paula J wrote:
TextPad has a search across all open documents, or all files 
in a directory.  The results are shown in a separate window and
double clicking the result takes you to that section of code in 
that file.  
Again like UltraEdit it's not free, but in the same price range.
It also has color syntax highlighting for perl and you can set up 
the tools to execute perl from within the editor.
http://www.textpad.com
Paula 

You can also supply a regex so that the output TP collects
from a command (Perl, Java, C) is hyperlinked by filename/line number.
So clicking error at X.pm, line 10 takes you there.
Another useful one is CTRL+M over a bracket (brace/angel-bracket, etc)
to find the matching pair
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: DESTROY Issue

2004-05-27 Thread Dirk Bremer \(NISC\)
 Some light from Camel book 3rd edition,
 12.6.1. Garbage Collection with DESTROY Methods:
 When an interpreter shuts down, all its objects are destroyed,
 which is important for multithreaded or embedded Perl applications.
 Objects are always destroyed in a separate pass before ordinary
 references. This is to prevent DESTROY methods from using references
 that have themselves been destroyed.

 But something wrong in ActiveState Perl ;-((
 Are objects destroyed earlier than references and filehandles?

 I found two ways to avoid errors:
 1. Rename DESTROY and manually call it like ordinary object method.
 2. Objects must destroyed before global destruction (like above).

 -- 
 Best regards,
  Lev


Lev,

I agree with your two assertions. It would appear that the answer to the
question is that filehandles are destroyed earlier than objects based upon
my testing. This is a very interesting subject that has repercussions for
filehandles in objects. I would love the opinion of an internals guru.

Dirk Bremer - Systems Programmer II - ESS/AMS  - NISC St. Peters
USA Central Time Zone
636-922-9158 ext. 8652 fax 636-447-4471

[EMAIL PROTECTED]
www.nisc.cc

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


CGI Help for a Newbie...

2004-05-27 Thread Jared Squires
In my defense I did my best to search the ActiveState
CGI and Win32 archives to get an answer to my
question, but with no definitive answer to my
question.

My experience:  Been reading Learning Perl for Win32
users for a couple weeks.  Lessons going well.  Have a
lot of HTML experience, some programming language
experience so that I understand loops, etc.

To the Point (the question):  If I install ActiveState
Perl onto a non-internet connected computer, can I
create an HTML file (client side) that has a form that
submits to a CGI file (client side - same computer)
and uses that data to create some MS word documents
from some templates?

The short answer would seem to be no, I need a server
on there, such as FrontPage or Apache, which is a bit
more in depth and requires more computer resources
than I want to commit.  However, if you can't do this
how do you debug a CGI script before putting it on the
server side.

My goal is to get an easy to use interface for my
father-in-law's business to auto generate some
contracts and maintain a mailing list and Perl seems a
great way to do it.  However, I know that his people
won't like using the console window to input stuff. 
Otherwise this would be pretty easy I think.

Thanks in advance for your advice and help.

Jared Squires

=

http://www.jaredsquires.com
Vast Wasteland of the Internet
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Editor - finding lines

2004-05-27 Thread Dirk Bremer \(NISC\)


Dirk Bremer - Systems Programmer II - ESS/AMS  - NISC St. Peters
USA Central Time Zone
636-922-9158 ext. 8652 fax 636-447-4471

[EMAIL PROTECTED]
www.nisc.cc
- Original Message - 
From: Lee Goddard [EMAIL PROTECTED]
To: Capacio, Paula J [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; Perl-Win32-Users
[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 09:12
Subject: Re: Editor - finding lines



 Capacio, Paula J wrote:

 TextPad has a search across all open documents, or all files
 in a directory.  The results are shown in a separate window and
 double clicking the result takes you to that section of code in
 that file.
 Again like UltraEdit it's not free, but in the same price range.
 It also has color syntax highlighting for perl and you can set up
 the tools to execute perl from within the editor.
 http://www.textpad.com
 Paula
 
 You can also supply a regex so that the output TP collects
 from a command (Perl, Java, C) is hyperlinked by filename/line number.
 So clicking error at X.pm, line 10 takes you there.

 Another useful one is CTRL+M over a bracket (brace/angel-bracket, etc)
 to find the matching pair
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Multi-Edit does this nicely in a separate pane that lists the results of the
search. You then click on any of the results and the main pane will be
positioned to the affected line. This works both for a single file/window or
multiple files/windows. Multi-Edit is not a free product, somewhere around
$100.00. I have used it for years and have been very happy with it. I have
also heard good things about UltraEdit.

Dirk Bremer - Systems Programmer II - ESS/AMS  - NISC St. Peters
USA Central Time Zone
636-922-9158 ext. 8652 fax 636-447-4471

[EMAIL PROTECTED]
www.nisc.cc


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Editor - finding lines

2004-05-27 Thread wardp
ConTEXT also does this and colours your text for a number of languages. Best
of all its freeware!

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dirk
Bremer (NISC)
Sent: 27 May 2004 15:32
To: Perl-Win32-Users
Subject: Re: Editor - finding lines




Dirk Bremer - Systems Programmer II - ESS/AMS  - NISC St. Peters USA Central
Time Zone 636-922-9158 ext. 8652 fax 636-447-4471

[EMAIL PROTECTED]
www.nisc.cc
- Original Message - 
From: Lee Goddard [EMAIL PROTECTED]
To: Capacio, Paula J [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; Perl-Win32-Users
[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 09:12
Subject: Re: Editor - finding lines



 Capacio, Paula J wrote:

 TextPad has a search across all open documents, or all files in a 
 directory.  The results are shown in a separate window and double 
 clicking the result takes you to that section of code in that file.
 Again like UltraEdit it's not free, but in the same price range.
 It also has color syntax highlighting for perl and you can set up
 the tools to execute perl from within the editor.
 http://www.textpad.com
 Paula
 
 You can also supply a regex so that the output TP collects from a 
 command (Perl, Java, C) is hyperlinked by filename/line number. So 
 clicking error at X.pm, line 10 takes you there.

 Another useful one is CTRL+M over a bracket (brace/angel-bracket, etc) 
 to find the matching pair 
 ___
 Perl-Win32-Users mailing list 
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Multi-Edit does this nicely in a separate pane that lists the results of the
search. You then click on any of the results and the main pane will be
positioned to the affected line. This works both for a single file/window or
multiple files/windows. Multi-Edit is not a free product, somewhere around
$100.00. I have used it for years and have been very happy with it. I have
also heard good things about UltraEdit.

Dirk Bremer - Systems Programmer II - ESS/AMS  - NISC St. Peters USA Central
Time Zone 636-922-9158 ext. 8652 fax 636-447-4471

[EMAIL PROTECTED]
www.nisc.cc


___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


EBRD SECURITY NOTICE
This email has been virus scanned


__
This message may contain privileged information. If you have received this message by 
mistake, please keep it confidential and return it to the sender.  
   
  
Although we have taken steps to minimise the risk of transmitting software viruses, 
the EBRD accepts no liability for any loss or damage caused by computer viruses and 
would advise you to carry out your own virus checks. 
The contents of this e-mail do not necessarily represent the views of the EBRD.
__

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: CGI Help for a Newbie...

2004-05-27 Thread Thomas R Wyant_III
[EMAIL PROTECTED] wrote:

 To the Point (the question):  If I install ActiveState
 Perl onto a non-internet connected computer, can I
 create an HTML file (client side) that has a form that
 submits to a CGI file (client side - same computer)
 and uses that data to create some MS word documents
 from some templates?

 The short answer would seem to be no, I need a server
 on there, such as FrontPage or Apache, which is a bit
 more in depth and requires more computer resources
 than I want to commit.  However, if you can't do this
 how do you debug a CGI script before putting it on the
 server side.

There are various things you can do:

First, you should join the Perl-Win32-Web mailing list.

Second, you should code your CGI using the Perl CGI module. This lets you 
test the script interactively, and pass any CGI arguments on the command 
line. Output is checked either by eyeballing the HTML or redirecting it to 
a file and opening that file in your favorite browser. At least during 
testing, you may want to use CGI::Pretty rather than CGI, so your output 
gets formatted nicely and you can eyeball it better. I also recommend 
CGI::Carp qw{fatalsToBrowser}. In fact, I recommend that your script start 
thusly:

#!path_to_perl_executable (if you're using Apache)

use strict;
use warnings;

use CGI::Pretty qw{:standard};
use CGI::Carp qw{fatalsToBrowser};

# Here follows the script to generate your web page. For example:

my $name = param ('name') || 'World';
my $text = Hello, $name!;

print header, start_html ($text),
h1 ({align = 'center'}, $text),
end_html;

#disclaimer - the above is not guaranteed to compile, much less
#execute.
__END__

You might (and in fact probably will) want to tweak what you import from 
CGI (or equivalently CGI::Pretty); ':standard' is just the bare bones.

I'm told that Lynx will execute CGI scripts and display the results, but I 
haven't done this, and if you're checking the look-and-feel, Lynx tells 
you very little about what your data will look like using a GUI browser 
like Internet Explorer of Mozilla.

But be aware that the only way to tell if your CGI script works with a 
given web server is to run it via that web server. There are a lot of 
things that can go wrong. For example, the web server won't give the 
script the same default directory as you develop under, and will almost 
certainly have more restricted file access than you do. It may (depending 
on the server - e.g. Apache) not import all the environment variables you 
see interactively. Or it may not know how to execute Perl scripts (IIS: 
missing or incorrect file association, and under Windows 2003 you have to 
do some extra and _very_ obscurely documented setup; Apache: incorrect or 
missing shebang line, or server not configured to use file association, or 
missing or incorrect association.)

I really recommend installing a web server on your development machine. 
IIS is easier to set up (especially if you're requiring an explicit 
username/password), but Apache is lighter-weight. Further than that I 
won't comment; last time I did in this forum the flame war lasted for 
days. Given the choice, you should prefer on your development machine the 
web server you're targeting. You can certainly cross-develop, and I do. It 
just means you'll need to learn the idiosyncracies of more than one web 
server.

Tom Wyant


This communication is for use by the intended recipient and contains 
information that may be privileged, confidential or copyrighted under
applicable law.  If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited.  Please notify the sender
by return e-mail and delete this e-mail from your system.  Unless
explicitly and conspicuously designated as E-Contract Intended,
this e-mail does not constitute a contract offer, a contract amendment,
or an acceptance of a contract offer.  This e-mail does not constitute
a consent to the use of sender's contact information for direct marketing
purposes or for transfers of data to third parties.

 Francais Deutsch Italiano  Espanol  Portugues  Japanese  Chinese  Korean

http://www.DuPont.com/corp/email_disclaimer.html


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


perl/spider/crawling question...

2004-05-27 Thread bruce
hi...

we're looking at creating a project/app to extract information from
university websites. we know we can write a separate individual perl
app/scipt for each school which would crawl/parse/extract the information we
need. however, we'd rather not write a unique perl script for each school if
there is a better/more efficient way.

anybody have any good suggestions, preferably with code samples!!

thanks for any help/assistance/pointers/etc...

bruce
[EMAIL PROTECTED]


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: CGI Help for a Newbie...

2004-05-27 Thread Jared Squires
That's the thing... I don't want to have to deal with
the problems of maintaining a server.  My
father-in-law is very twitchy when it comes to company
information that even has a modem in it.

What Im trying to learn I guess.  Will myform.html
with some kind of HTML like form ... method = post
action=c:\perl\mycgi.pl work on a client-ONLY
computer that has PERL installed on it.  Is the
method = post part of the server protocol, or is it
something else.

=

http://www.jaredsquires.com
Vast Wasteland of the Internet
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: perl/spider/crawling question...

2004-05-27 Thread Peter Eisengrein
Title: RE: perl/spider/crawling question...





if you can assume the info you want is somehow linked to their main page (either directly or by proxy) then you should be able to keep a file or database of each school's url. Then use on of the various modules (Win32::Internet, LWP, etc) to get the webpage. Then parse through it to find links to more pages. I would add each url you find to an array. Once you have crawled each page listed in the array, then you go back to your master list and move on to the next school.

Also look at HTML::Parser and related modules




 -Original Message-
 From: bruce [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 27, 2004 11:42 AM
 To: [EMAIL PROTECTED]
 Subject: perl/spider/crawling question...
 
 
 hi...
 
 we're looking at creating a project/app to extract information from
 university websites. we know we can write a separate individual perl
 app/scipt for each school which would crawl/parse/extract the 
 information we
 need. however, we'd rather not write a unique perl script for 
 each school if
 there is a better/more efficient way.
 
 anybody have any good suggestions, preferably with code samples!!
 
 thanks for any help/assistance/pointers/etc...
 
 bruce
 [EMAIL PROTECTED]
 
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: CGI Help for a Newbie...

2004-05-27 Thread Dennis G. Wicks
On Thu, 27 May 2004, Jared Squires wrote:

 Date: Thu, 27 May 2004 08:46:07 -0700 (PDT)
 From: Jared Squires [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: CGI Help for a Newbie...

 That's the thing... I don't want to have to deal with
 the problems of maintaining a server.  My
 father-in-law is very twitchy when it comes to company
 information that even has a modem in it.

 What Im trying to learn I guess.  Will myform.html
 with some kind of HTML like form ... method = post
 action=c:\perl\mycgi.pl work on a client-ONLY
 computer that has PERL installed on it.  Is the
 method = post part of the server protocol, or is it
 something else.

Greetings;

Well, you can do what you want to do, but why bother? Do you
want to spend your time creating a great application or
figuring out ways to get around the problems involved in not
having a real server?

Since you are not attached to the 'net you don't have to
worry about all the terrible things you have heard about.

As far as the problems of maintaining a server there
aren't any. The problems arise because servers are usually
connected to the internet and are publicly accessible, and
all the things that are associated with that. Yours won't
be.

If you have the Activestate and Apache CDs you can start in
the morning, have both installed and working by noon, and
have something running by dinner time. Just tell Apache to
listen on localhost port 80.

I maintain five web sites using such a configuration and I
tried what you are thinking of. Then I found out that Apache
runs on Windows. I installed it and haven't regretted it.

Good Luck!
Dennis
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: perl/spider/crawling question...

2004-05-27 Thread Mike Jackson
as for spidering trees, stacks are always great fun to set up :)
consider:
my @stack;
# first we seed the stack (we only need one item to start!)
while () {
  chomp;
  push @stack, $_;
}
# now that our stack is seeded, do stuff with it!
while (@stack) {
  my $item = pop @stack;
  $information_about_something_that_needs_doing = do_something_with($item);
  if (some_condition_that_finds_something_that_needs_doing) {
push @stack, $information_about_something_that_needs_doing;
  }
}
# now everything has been done!
if you're crawling sites, just push all URLs found onto the stack - and set the item 
processor to accept URLs for examining.. perhaps create a launch page, and manually 
seed the stack with that? you could make the launch page a reference to a cgi script...
if you are crawling using the above, you'd want to add a check to restrict the bounds 
of your search, just in case one of your sites links to slashdot, or google or 
something like that...
if you're curious, the above implements a breadth-first type algorithm. If you merely 
followed each link as it was found, that would be a depth-first. really depends on 
what you want :)
On Thu, 27 May 2004 13:13:30 -0400, Peter Eisengrein [EMAIL PROTECTED] wrote:
if you can assume the info you want is somehow linked to their main page
(either directly or by proxy) then you should be able to keep a file or
database of each school's url. Then use on of the various modules
(Win32::Internet, LWP, etc) to get the webpage. Then parse through it to
find links to more pages. I would add each url you find to an array. Once
you have crawled each page listed in the array, then you go back to your
master list and move on to the next school.
Also look at HTML::Parser and related modules

-Original Message-
From: bruce [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 11:42 AM
To: [EMAIL PROTECTED]
Subject: perl/spider/crawling question...
hi...
we're looking at creating a project/app to extract information from
university websites. we know we can write a separate individual perl
app/scipt for each school which would crawl/parse/extract the
information we
need. however, we'd rather not write a unique perl script for
each school if
there is a better/more efficient way.
anybody have any good suggestions, preferably with code samples!!
thanks for any help/assistance/pointers/etc...
bruce
[EMAIL PROTECTED]
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: perl/spider/crawling question...

2004-05-27 Thread Martin Leese
bruce [EMAIL PROTECTED] wrote:
hi...
we're looking at creating a project/app to extract information from
university websites. we know we can write a separate individual perl
app/scipt for each school which would crawl/parse/extract the information we
need. however, we'd rather not write a unique perl script for each school if
there is a better/more efficient way.
anybody have any good suggestions, preferably with code samples!!
thanks for any help/assistance/pointers/etc...
If you unleash a spider, don't forget to build in support
for avoiding pages when requested to do so.  Visit:
http://www.robotstxt.org/wc/exclusion.html
Also, a good place to start would be The Web Robots FAQ
at http://www.robotstxt.org/wc/faq.html
This suggests a book or three on spiders.
Regards,
Martin
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs