[25025] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7275 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 20 14:07:16 2004

Date: Wed, 20 Oct 2004 11:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 20 Oct 2004     Volume: 10 Number: 7275

Today's topics:
        backup utility for remote hosts (dan baker)
    Re: Calling a perl script from an html doc lesley_b_linux@yahoo.co.yuk
    Re: Change filedate (David Efflandt)
    Re: Change filedate <dreamer@cox.net>
        eval function <ioneabu@yahoo.com>
    Re: eval function <ioneabu@yahoo.com>
    Re: eval function <uguttman@athenahealth.com>
        How can I know if STDOUT has been redirected? <bik.mido@tiscalinet.it>
    Re: How can I know if STDOUT has been redirected? (Anno Siegel)
    Re: How do I print http 404 not found header? lesley_b_linux@yahoo.co.yuk 
    Re: is it possible? <jwillmore@adelphia.net>
    Re: is it possible? <spamtrap@dot-app.org>
    Re: options to shrink-wrap a perl script (dan baker)
    Re: options to shrink-wrap a perl script <uri@stemsystems.com>
    Re: perl to english <ioneabu@yahoo.com>
    Re: perl to english <spamtrap@dot-app.org>
        Regex matching non-contiguous sheds of text <elektrophyte-yahoo>
    Re: Special encoded character <zentara@highstream.net>
    Re: Suggestion: Use EPIC as a perl editor/debugger <1usa@llenroc.ude.invalid>
    Re: Toronto Perl Mongers - Audio Recordings burlo_stumproot@yahoo.se
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 20 Oct 2004 09:52:18 -0700
From: botfood@yahoo.com (dan baker)
Subject: backup utility for remote hosts
Message-Id: <13685ef8.0410200852.740c8bf4@posting.google.com>

I recently hacked together a little utility to backup files from
multiple remote hosts to a local PC. The host I use for a lot of
websites does not offer nightly backups, and while they haven't
crashed yet, I wanted to pull copies of databases and other files that
get modified by server-side scripts.

I thought that I'd just post the source in case:
- people want to make constructive comments about how to improve the
code
- somebody needs a similar utility and can start with this source and
run with it.
- because I have used a lot of other people's modules, and thought
maybe this
  would help somebody else out.

There are two files. The script, and a config file with the host and
file information.

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

#! /usr/bin/perl -w

=head1
# ------------------------------------------------------------------------------

Purpose - 
	This script backs up specific files from the web to local PC. Its
	intended to be run nightly by Task Manager on a PC as an "automated"
	utility that is capable of getting multiple files from multiple
servers
	sequentially. Intended to get databases, or other files that may
	have been changed by server-side tools, and archive to a local PC
just for
	backup in cases where the Host does not offer nightly backups, or you
	may not trust them to DO them.

Input - 'requires' a config file "config_files.txt" that lists
host,user,password
	and files to be backed up

Output - 
	- pulls files from remote webserver and creates a 'mirror' directory
	structure below this script on the local computer.

	- creates a log file and emails to desigated address for feedback

History - 
	written by dan_at_dtbakerprojects.com 10/2004

# ------------------------------------------------------------------------------
=cut
# 3456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-
# ------------------------------------------------------------------------------
# ##############################################################################

# hardcoded parameters

$pCGI_debuglog 	= './debug.txt'; 

my $cSMTPserver		= 'smtp.yourhost.net' ;
my $Sender 		= '"Your Name"<you@yourdomain.com>';
my $Recipient 		= $Sender ;
my $Subject 		= 'web backup utility results' ; 
my $Type 		= 'text/plain';
my $Body ='';

# ##############################################################################
# ------------------------------------------------------------------------------
# external modules

	use Net::FTP;
	use MIME::Lite ;

# ------------------------------------------------------------------------------
# init local vars

	my $tempString = '' ;
	my @tempList = () ;
	my %tempHash = () ;
	my $tempStatus = '';

local $host	= '';
local $username	= '';
local $password	= '';
local @FileList	= ();
local $LastRun 	= 0;

my $ftp		= '';
my $DirPath	= '';
my $LocalPath 	= '';
my $FileExt	= '';
my $CurrType	= 'binary';
my $LastType	= 'ascii';

# ########################### Start Main Executable code
#######################

# grab the timestamp from debug file to tell when last run

if (-f $pCGI_debuglog ) {
	@tempList = stat($pCGI_debuglog);
	$LastRun = $tempList[9];
} else {
	$LastRun = 0;
}

$cDEBUG 	= 1 ; 	# set to 0 NOT to print debug statements to STDERR 
			# set to 1 for high-level diagnostics
			# set to 'verbose' for detailed diagnostics

$cDEBUG_type = 'overwrite' ; 
			# 'append' | 'overwrite' debug file

# clear and init logfile
if ( $cDEBUG ) {

    if ( $cDEBUG_type eq 'append' ) { # append
	    open( DEBUG_LOG , ">>$pCGI_debuglog" ) or 
		die "Failed to open log at $pCGI_debuglog because $!" ;
	    print DEBUG_LOG "appending to log" ;

    } else {
	    open( DEBUG_LOG , ">$pCGI_debuglog" ) or 
		die "Failed to open log at $pCGI_debuglog because $!" ;
	    print DEBUG_LOG "cleared log" ;
    }

    print DEBUG_LOG " at [".scalar(localtime)."]\n" ;
    close DEBUG_LOG ;
}

# redirect stderr to the log
# -----
close STDERR ; 
open( STDERR , ">>$pCGI_debuglog" ) or 
	die "Failed to redirect SDTERR because $!"  ;
print STDERR "running: $0\n\n" ;
print scalar(localtime)." running: $0\n\n" ;

# ...and leave open for runtime errors 
# note that runtime msgs can be printed to STDERR regardless of
$cDEBUG

# ------------------------------------------------------------------------------

require "config_files.txt" ; # pull in the hosts/files to be backed up

# ------------------------------------------------------------------------------

print "\n\n".scalar(localtime)." ...all done, normal exit.\n";
print STDERR "\n\n".scalar(localtime)." ...all done, normal exit.\n";
close STDERR;

# ##############################################################################
# mail the log to admin

open( DEBUG_LOG , "<$pCGI_debuglog" ) ;
$Body = join('',(<DEBUG_LOG>) ) ;

MIME::Lite->send('smtp', $cSMTPserver , Hello=> $cSMTPserver,
Timeout=>60 );
 
unless ($Type ) { $Type = 'text/plain' }
	
	# send mail
	# -----
    		my $msg = MIME::Lite->new(
			From	=> $Sender ,
			To      => $Recipient ,
			Subject => $Subject ,
			Type    => $Type ,
			Data 	=> $Body 
		);

$msg->send() ;

# ##############################################################################

exit;

# ##############################################################################
# ##############################################################################
sub GetFiles {

$ftp = Net::FTP->new($host);

print STDERR "\nLogging into $host \n" ;
print "\nLogging into $host \n";
unless ( $ftp->login( $username , $password ) ) {
	print "login to $host failed \n";
	print STDERR "login to $host failed \n";
	sleep 5;
	return(1);
}

foreach $File (@FileList) {
	
	# check directory tree
	# -----
	$LocalPath = '.';
	$DirPath = $host.$File ;
	$DirPath =~ s/(.+)\/.*$/$1/ ;
	unless ( -d $DirPath ) {
		print "gotta create local directories first...\n";

		@tempList = split ('/', $DirPath );
		foreach $tempString ( @tempList ) {
			$LocalPath .= "\/$tempString" ;
			unless (-d $LocalPath ) {
				print "mkdir $LocalPath \n";
				mkdir($LocalPath , 0777);
			}
		}
	}

	# check type
	# -----
	if ( $File =~ m/.*\.(.+)$/ ) {

	    	if (	( $1 eq 'pdf' ) or
			( $1 eq 'jpg' ) or
			( $1 eq 'gif' ) )
		{
			$CurrType = 'binary';
	    	} else { 
			$CurrType = 'ascii';
		}

	} else { # no file extension, assume it is binary
		$CurrType = 'binary';
	}
	unless ( $LastType eq $CurrType) {
		print "setting type to $CurrType\n";
		$ftp->type($CurrType);
		$LastType = $CurrType ;
	}

	# check mod time
	# ignoring any time diff between local PC and remote server since
	# we will catch a backup the next day even if the times are off a
couple hours
	# --------------
	if (	( -f "${host}${File}" ) and
		( $ftp->mdtm($File) <= $LastRun )) {

		print "$File has not been modified since $LastRun \n";
		print STDERR "$File has not been modified since $LastRun \n"
			if ($cDEBUG eq 'verbose');
		next;
	}

	# get file
	# -----
	print "getting $File \n";
	print STDERR "getting $File \n" if ($cDEBUG eq 'verbose') ;
	$tempStatus = $ftp->get( $File, "${host}${File}" );

	unless ( $tempStatus ) {
		print "transfer failed, check error log... \n";
		print STDERR "getting $File failed\n" ;
	}
}

$ftp->quit;
1;
}

# ##############################################################################
1; # ------------------------- end of file
-------------------------------------





 ....and the config file example



# config_files.txt
# ----------------
# create a section for each host, and list the files to backup
# be sure to make a call to &GetFiles between each!

# ##############################################################################
$host		= 'host1.com' ;
$username	= 'user1' ;
$password	= 'password1';
@FileList	= qw(
	/public_html/employees/cgi-bin/databases/DB_OrderInfo
);

&GetFiles;

# ##############################################################################

# ... copy section for another host here...

# ##############################################################################
1; # end of config_files.txt


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

Date: 20 Oct 2004 14:59:06 +0100
From: lesley_b_linux@yahoo.co.yuk
Subject: Re: Calling a perl script from an html doc
Message-Id: <m3d5zdwkwl.fsf@helmholtz.local>

Tad McClellan <tadmc@augustmail.com> writes:

> lesley_b_linux@yahoo.co.yuk <lesley_b_linux@yahoo.co.yuk> wrote:
> 
> > One of the reasons I don't
> > read this one is because of the high signal to noise ratio.
>                                   ^^^^
> 
> 
> Surely you mean *low* S/N ratio?
> 

yes :)
tyvm

L.


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

Date: Wed, 20 Oct 2004 13:39:57 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Change filedate
Message-Id: <slrncncqld.s0i.efflandt@typhoon.xnet.com>

On Tue, 19 Oct 2004 23:42:10 -0700, Fred Hare <dreamer@cox.net> wrote:
> I need to change the file creation dates of textfiles using Perl in 
> Windows XP. I have path and filename in $filename and the new date in 
> $newdate but I cannot find the command for changing the filedates.
> 
> -- Fred

perldoc -f utime

This works for changing access and modification times on Unix (and like)  
systems, but not sure about Windows.  It takes a list of NUMERICAL
(seconds past the epoch) access and modification times for first 2
elements of list and rest of list is files to change.  It returns number
of files actually changed.


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

Date: Wed, 20 Oct 2004 08:23:34 -0700
From: Fred Hare <dreamer@cox.net>
Subject: Re: Change filedate
Message-Id: <N6mdnYG2AbBhH-vcRVnygw@got.net>

David Efflandt wrote:
> On Tue, 19 Oct 2004 23:42:10 -0700, Fred Hare <dreamer@cox.net> wrote:
> 
>>I need to change the file creation dates of textfiles using Perl in 
>>Windows XP. I have path and filename in $filename and the new date in 
>>$newdate but I cannot find the command for changing the filedates.
>>
>>-- Fred
> 
> 
> perldoc -f utime
> 
> This works for changing access and modification times on Unix (and like)  
> systems, but not sure about Windows.  It takes a list of NUMERICAL
> (seconds past the epoch) access and modification times for first 2
> elements of list and rest of list is files to change.  It returns number
> of files actually changed.

Thank you David, this works fine in Win XP...

-- Fred


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

Date: Wed, 20 Oct 2004 13:09:21 -0400
From: wana <ioneabu@yahoo.com>
Subject: eval function
Message-Id: <10nd7439e4s406d@news.supernews.com>

I reworked my SaveToFile function with much advice from this group.  I ended
up combining four functions into one which was nice.

sub SaveToFile
#takes scalar, scalar ref or array ref and a file name as arguments
#and saves contents to file.  Third, optional, arg: the word
#'append' will put in append mode.
{
        my ($data, $filename, $append) = @_;
        $_ = $append;
        $append = (defined and /^append$/i) ?'>>':'>';
        open my $file, $append, $filename 
                or die "Couldn't open $filename: $!";
        print $file @$data if ref($data) eq "ARRAY";
        print $file $$data if ref($data) eq "SCALAR";
        print $file $data if not ref $data;
        close $file or die "Error closing $filename: $!";
}

This is my first use ever of the ternary/trinary operator.  It was not
nearly as bad as I thought.

wana


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

Date: Wed, 20 Oct 2004 13:11:48 -0400
From: wana <ioneabu@yahoo.com>
Subject: Re: eval function
Message-Id: <10nd78km7s6n8f9@news.supernews.com>

Sorry about subject name.  It was supposed to be 'SaveToFile function
reworked' or something like that.  I hit send too quickly.

wana


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

Date: Wed, 20 Oct 2004 13:17:13 -0400
From: Uri Guttman <uguttman@athenahealth.com>
Subject: Re: eval function
Message-Id: <m3wtxljome.fsf@linux.local>

>>>>> "w" == wana  <ioneabu@yahoo.com> writes:

  w> sub SaveToFile
  w> #takes scalar, scalar ref or array ref and a file name as arguments
  w> #and saves contents to file.  Third, optional, arg: the word
  w> #'append' will put in append mode.
  w> {
  w>         my ($data, $filename, $append) = @_;
  w>         $_ = $append;

blarg!! you just clobbered $_ which could be global (or localized) in
the caller.

  w>         $append = (defined and /^append$/i) ?'>>':'>';
  w>         open my $file, $append, $filename 
  w>                 or die "Couldn't open $filename: $!";
  w>         print $file @$data if ref($data) eq "ARRAY";
  w>         print $file $$data if ref($data) eq "SCALAR";
  w>         print $file $data if not ref $data;
  w>         close $file or die "Error closing $filename: $!";
  w> }

  w> This is my first use ever of the ternary/trinary operator.  It was not
  w> nearly as bad as I thought.

look at File::Slurp on cpan which has write_file (and append_file) and
which does this and much more and faster as well.

uri


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

Date: Wed, 20 Oct 2004 15:13:07 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: How can I know if STDOUT has been redirected?
Message-Id: <iiocn09kp6b3hf8ms4i9pcdqed7t85uou6@4ax.com>

As of the subject, I'd like to know if there's a way for a program to
understand wether STDOUT is connected to a tty or has been redirected,
like e.g. ls with --color=auto does. (Of course this is OS specific;
I'm specifically interested in the Linux case.)


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 20 Oct 2004 13:20:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How can I know if STDOUT has been redirected?
Message-Id: <cl5omf$4a7$1@mamenchi.zrz.TU-Berlin.DE>

Michele Dondi  <bik.mido@tiscalinet.it> wrote in comp.lang.perl.misc:
> As of the subject, I'd like to know if there's a way for a program to
> understand wether STDOUT is connected to a tty or has been redirected,
> like e.g. ls with --color=auto does. (Of course this is OS specific;
> I'm specifically interested in the Linux case.)

The file test -t checks if a filehandle is open to a tty.  It does
not check whether the handle has been redirected -- redirection is
a shell action that simply offers the other program the named file
as stdin (or stdout, or stderr).  There is no way you can look at
a filehandle and decide whether it was opened due to a redirect
action.

Anno


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

Date: 20 Oct 2004 18:35:00 +0100
From: lesley_b_linux@yahoo.co.yuk 
Subject: Re: How do I print http 404 not found header?
Message-Id: <m34qkpwawr.fsf@helmholtz.local>

"Alan J. Flavell" <flavell@ph.gla.ac.uk> writes:

> On Tue, 19 Oct 2004 lesley_b_linux@yahoo.co.uk wrote:
> 
<snip>
> As the relevant Perl FAQ says, at e.g
> http://www.perldoc.com/perl5.8.4/pod/perlfaq9.html#What-is-the-correct-form-of-response-from-a-CGI-script-
> 
Thanks for this URL.  Can, and if so would, you say why none of the URL's indicated in it are
hyperlinked?

>  The similarity between CGI response headers (defined in the CGI 
>  specification) and HTTP response headers (defined in the HTTP 
>  specification, RFC2616) is intentional, but can sometimes be 
>  confusing.
> 
> > However if you want a CGI specification the nearest I can offer was 
> > a URL posted in another thread --> 
> > http://hoohoo.ncsa.uiuc.edu/cgi/overview.html
> 
> Actually, I prefer the one referenced in the Perl FAQ part 9:
> 
>  Current best-practice RFC draft at: http://CGI-Spec.Golux.Com/

tyvm for this link too.

Regards

L.


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

Date: Wed, 20 Oct 2004 12:27:46 -0400
From: James Willmore <jwillmore@adelphia.net>
Subject: Re: is it possible?
Message-Id: <woqdnQtPMfNmDOvcRVn-qA@adelphia.com>

Arndt Jonasson wrote:
> James Willmore <jwillmore@adelphia.net> writes:
> 
>>(from `perldoc -q 'command'`)
>>=begin
>>       How can I capture STDERR from an external command?
>>
>>        There are three basic ways of running external commands:
>>
>>            system $cmd;                # using system()
>>            $output = ‘$cmd‘;           # using backticks (‘‘)
>>            open (PIPE, "cmd │");       # using open()
> 
> 
> I don't know about others, but I'm getting some strange binary
> sequences above, where according to "perldoc -q command", when I run
> it, there should be simple backquotes and vertical bars. Just thought
> I'd point it out.

My newsreader and me are having a bit of a disagreement.  I didn't 
realize that the last post was sent with garbage.  Sorry.

Jim


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

Date: Wed, 20 Oct 2004 12:36:31 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: is it possible?
Message-Id: <doKdnTgykrmNCevcRVn-iQ@adelphia.com>

Arndt Jonasson wrote:

> I don't know about others, but I'm getting some strange binary
> sequences above, where according to "perldoc -q command", when I run
> it, there should be simple backquotes and vertical bars. Just thought
> I'd point it out.

According to my news client, the post you're referring to is encoded as 
UTF-8, whereas yours is ISO-8859-1. Your news reader apparently doesn't 
like UTF-8.

sherm--

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


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

Date: 20 Oct 2004 07:29:55 -0700
From: botfood@yahoo.com (dan baker)
Subject: Re: options to shrink-wrap a perl script
Message-Id: <13685ef8.0410200629.47e94ab7@posting.google.com>

Now THIS is a truely killer response. actually answered more than I
needed to know, and threw in comments about the actual usability of
the solution which I found enlightening. Anyone reading this post
later has a lot more information to work with and some idea of the
potential pitfalls.

All I really needed to know was that there is a module PAR on CPAN.org
that includes a pp utility. It was informative to know that the
results are generally quite large... I may re-think my distribution
plan to several clients and just run the backup utility from MY
computer.

Thank you J. Romano. 

You have renewed my faith that there are people in this group capable
of demonstrating not only knowledge, but are interested in giving
complete and thoughtful answers.

D


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

Date: Wed, 20 Oct 2004 14:48:01 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: options to shrink-wrap a perl script
Message-Id: <x7hdopcurb.fsf@mail.sysarch.com>

>>>>> "db" == dan baker <botfood@yahoo.com> writes:

  db> You have renewed my faith that there are people in this group capable
  db> of demonstrating not only knowledge, but are interested in giving
  db> complete and thoughtful answers.

and you have renewed my faith in that there will always be those who
need hand holding and then whine about it.

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: Wed, 20 Oct 2004 13:17:38 -0400
From: wana <ioneabu@yahoo.com>
Subject: Re: perl to english
Message-Id: <10nd7jjbth9ni03@news.supernews.com>

Helgi Briem wrote:

> On 19 Oct 2004 20:23:59 -0700, bulk88@hotmail.com (buildmorelines)
> wrote:
> 
>>Is there any script or pragma or something that will translate perl
>>code to pure english, like that perl latin module, just in english. I
>>want to show a person who cant read perl code or any computer
>>language, some perl code, so they have remotly a clue what the code
>>does or how it flows. It doesnt need to perfectly make sense or be
>>proper english sentences. Just soemthing that will translate perl code
>>and/or syntax to english.
> 
> Well written Perl is already as close to English as code gets.

In my opinion, SQL is slightly closer to English than Perl.  But then again,
SQL is a 4G language and Perl is 3G I think.  How about writing English
comments mixed in with your code and write a program that can extract and
format the comments?  Has anyone tried doing that?

> 
> --
> Helgi Briem  hbriem AT simnet DOT is
> 
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing on usenet and in e-mail?



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

Date: Wed, 20 Oct 2004 13:29:53 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: perl to english
Message-Id: <kbCdnYxZ6L8PPevcRVn-sQ@adelphia.com>

wana wrote:

> How about writing English
> comments mixed in with your code and write a program that can extract and
> format the comments?  Has anyone tried doing that?

The comments you're talking about here are called "POD", and the program 
to extract them is called "perldoc". There are also a number of pod2foo 
programs for translating the comments into other formats.

sherm--

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


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

Date: Wed, 20 Oct 2004 10:26:17 -0700
From: DM <elektrophyte-yahoo>
Subject: Regex matching non-contiguous sheds of text
Message-Id: <41769fe2$0$796$2c56edd9@news.cablerocket.com>

I'm trying to design a regular expression to match the href attribute of <a> 
tags. I'm testing it on the command line (on Redhat Linux Enterprise Server) 
using grep with the Perl regex option.

Here's the command I'm using:

# grep -rHInPo --color=auto 'href=.*TEA-21_Side-by-Side\.pdf[^>]*>' 
/home/mtc_website/

(On my console, the above is all one line. The URL part -- 
"TEA-21_Side-by-Side\.pdf" in this example, would be determined at runtime in 
the actual Perl script.)

It almost works as expected. I set the color and -o options in order to clearly 
show the highlighted match. In most cases it *does* match exactly what I want it to.

However, in a few cases what is matched is totally unexpected.

Here is some sample output:

================================================================================

# grep -rHInPo --color=auto 'href=.*TEA-21_Side-by-Side\.pdf[^>]*>' 
/home/mtc_website/
/home/mtc_website/whats_happening/legislative_update/tea21_04-04.htm:43:href="TEA-21_Side-by-Side.pdf">
/home/mtc_website/whats_happening/legislative_update/tea21_06-04.htm:42:href="TEA-21_Side-by-Side.pdf">
                     <li> <a href="TEA-21_Side-by-Side.pdf">rong> 
<ul>ng="5">.ca.gov</a>  s tober LATIVE UPDATE" width="340" height="14" border="0" />

================================================================================

In the file "tea21_06-04.htm" it's going beyond what I indend to match and 
scooping up a bunch more stuff. But it isn't even clear to me what it's matching 
because the output shows discontinuous shreds of text from within the file.

Here is a sample of that file containing the unexpected match:

================================================================================

               <td bgcolor="#CCFFFF"><strong>DOWNLOAD:</strong> <ul>
                   <li> <a href="TEA-21_Side-by-Side.pdf">Comparison of Highway
                     Provisions in Surface Transportation Reauthorization Bills</a>
                     (PDF)
                     <p> </p>
                   </li>
                   <li><a href="HR3550-High-Priority_Proj.xls">H.R. 3550 
High-Priority
                     Projects</a> (Excel)<br />
                   </li>
                 </ul></td>
             </tr>
           </table>
           <p><br />
             <strong>TEA 21 Reauthorization Conference Committee Comes Closer to
             Agreement on Bottom Line Number</strong><br />

================================================================================

Any help would be greatly appreciated.

Thanks,

dm


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

Date: Wed, 20 Oct 2004 09:52:24 -0400
From: zentara <zentara@highstream.net>
Subject: Re: Special encoded character
Message-Id: <l7rcn092gvq2ac4telfoga9g5urelj8euv@4ax.com>

On Tue, 19 Oct 2004 13:27:38 +0200, "Yoann Wyffels"
<yoann.wyffels@iloahosting.com> wrote:

>Hi,
>
>I catch text from a telnet session (with Net::Telnet Module).
>Unfortunately, in what I catch, I've got some strange characters which are 
>encode like this: "\195\169.....".
>For exemple: \195 = é
>
>I don't know what's encode's name it is...? Do you have an idea ?
>And do you know how to transform them into normal character ?
>
>Thx a lot,
>Regards,
>Yoann.

This script might help...but it might corrupt your terminal.
remember "reset".

#!/usr/bin/perl -C
# by Tim Toady of perlmonks 
#show-unicode.pl

binmode STDOUT, ":utf8";
$pat = "@ARGV";
if (ord $pat > 256) {
    $pat = sprintf("%04x", ord $pat);
 }
   elsif (ord $pat > 128) {        # arg in sneaky UTF-8 
     $pat = sprintf("%04x", unpack("U0U",$pat));
}

@names = split /^/, do 'unicore/Name.pl';

for (@names) {
  if (/$pat/io) {
      $hex = hex($_);
      print chr($hex),"\t",$_;
   }
}

__END__


-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


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

Date: 20 Oct 2004 14:33:10 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Suggestion: Use EPIC as a perl editor/debugger
Message-Id: <Xns95886B593B45Fasu1cornelledu@132.236.56.8>

Vijayaraghavan Kalyanapasupathy <vijai.lists@gmail.com> wrote in 
news:MPG.1bdfd315aee5059f989683@news.vanderbilt.edu:

> If you are new to Perl (like me) and use Eclipse, then I suggest the 
> EPIC (Eclipse Perl Integration) plugin for Eclipse (http://e-p-i-
> c.sf.net/
> 
> I have found many of the features very useful for example:
> 
> 1. Right click on warnings and select "Explain Errors/Warnings" 
> 2. The ability to have a small window by the side with perl doc for
>    function specified etc.
> 
> Just a suggestion, hope it's useful. I apologize if this is off-topic.

Given that it is about a FAQ (see perldoc -q editor) it can't really be 
that off-topic :) You might want to contact the FAQ maintainers (perldoc 
perlfaq for the info) and contribute to the answer to this question.

Sinan.


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

Date: Wed, 20 Oct 2004 15:07:26 GMT
From: burlo_stumproot@yahoo.se
Subject: Re: Toronto Perl Mongers - Audio Recordings
Message-Id: <u4qkpzavr.fsf@notvalid.se>

Fulko Hew <fulko.hew@sita.aero> writes:

> As an experiment I've recorded all of the presentations at the latest
> Toronto Perl Mongers "Lightning Talk" session.  But so far, I've only
> made them available to members of the Toronto group.
> 
> It was my thought that by making these recordings available, others who
> don't currently come out to meetings would find out how wonderfully
> useful our meetings can be and encourage them to come out and participate.
> 
> I also thought it might encourage other Perl Monger groups to record
> their meetings and make them available for the same reasons.
> 
> I haven't made our recordings available to the world yet, because I'm
> afraid of the Slash dot effect and the bandwidth cost to the person
> who's hosting the files.
> 
> Is there someplace out there that would be willing to host the files and
> provide the bandwidth?  Not just for us, but perhaps for everyone if it
> catches on!
> 
> 
> Comments anyone?
> 
> Fulko

Have you considered distributing it with bittorrent?

/me



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

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 7275
***************************************


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