[9502] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3097 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 8 14:17:21 1998

Date: Wed, 8 Jul 98 11:01:34 -0700
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, 8 Jul 1998     Volume: 8 Number: 3097

Today's topics:
        POST <pbm@iotp.demon.co.uk>
    Re: Problem in Variable String to Open() <ernestm@towery.com>
    Re: Problem in Variable String to Open() (brian d foy)
    Re: Protecting a HTML (I R A Aggie)
    Re: Quaintness involving the /x modifier, a comment and (Sitaram Chamarty)
    Re: Save attachment as a seperate file (Josh Kortbein)
    Re: Searching a file <quednauf@nortel.co.uk>
    Re: serious bug in Time::Local? <Russell_Schulz@locutus.ofB.ORG>
        Text::MetaText Features  (Andy Wardley)
    Re: Text::MetaText Re: methods to insert/substitute blo (Andy Wardley)
    Re: tough regexp - help needed (Abigail)
    Re: What are "callbacks"? (Sitaram Chamarty)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 8 Jul 1998 17:14:38 +0100
From: In off the Post <pbm@iotp.demon.co.uk>
Subject: POST
Message-Id: <6P8a8BAur5o1Ewa3@iotp.demon.co.uk>

        I'm trying to post form data to a perl cgi script from Java via
a socket on port 80 and the script should write the data posted to a
file. Its fairly simple, test like stuff at the present. The Java code
works okay, but no file is saved.

Does anyone have any ideas?

The java code is:

Socket s = new Socket(getCodeBase().getHost(), 80);
PrintWriter to_server = new PrintWriter(new OutputStreamWriter(s.getOutp
utStream()));
InputStream from_server = s.getInputStream();
String outdata = "team=Scunthorpe&p6=1404&filename=/home/iotp/ef/hello.d
at";
to_server.println("POST /cgi-bin/io.cgi HTTP/1.0");
to_server.println("Content-type: application/x-www-form-urlencoded");
to_server.println("Content-length: " + outdata.length());
to_server.println();
to_server.println();
to_server.println(outdata);
to_server.flush();
String st = "";
byte[] buffer = new byte[4096];
int bytes_read;
while((bytes_read = from_server.read(buffer)) != -1)
        st += buffer;
g.drawString("Data read is: "+st, 560, 1080);
s.close();

The perl code is:

#!/bin/perl

if ($ENV{'REQUEST_METHOD'} eq "POST") {
        umask 0;
        $file = "/home/iotp/html/saved.txt";
        open (IO, ">$file") || die "Can't open $file/n";
        read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
        @pairs = split /&/, $buffer;
        foreach (@pairs) {
                ($name, $value) = split /=/;
                $value =~ tr/+/ /;
                $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack('C',
hex($1))/eg;
                $data{$name} = $value;
                print IO "$name = $value\n";
        }
        close(IO);
        chmod IO, 0644;
        print "this was WRITTEN back!!!\n";
}

So the saved file should read:

team = Scunthorpe
p6 = 1404
filename = /home/iotp/ef/hello.dat

And the Java code should return the string "this was WRITTEN back!!!\n",
although I'm not really interested in this. It's the file writing that
is the *BIG* problem.

Cheers, willa.
-- 
willa



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

Date: Wed, 08 Jul 1998 10:46:30 -0500
From: Ernest Mueller <ernestm@towery.com>
To: Martien Verbruggen <mgjv@comdyn.com.au>
Subject: Re: Problem in Variable String to Open()
Message-Id: <35A39456.A02468E3@towery.com>

Martien Verbruggen wrote:
> 
> In article <35A2D341.86D48545@towery.com>,
>         Ernest Mueller <ernestm@towery.com> writes:
> 
> > $arg1 = FORM{arg1}; # from a CGI handler
> 
> Did you mean $FORM{arg1} ?
> 
> Maybe you should consider running perl with the -w option, and
> probably even with use strict. You should also consider checking
> whether $FORM{arg1} actually has anything in it, which is not
> dangerous.

Whoops, sorry - I do mean $FORM{arg1}.  And my &parse_form does scrub
the inputs, and I'm using Taint checking.  I've read the relevant
sections in the FAQ and am familiar with the security issues surrounding
Perl CGI programming.

Ooooh, in fact, it looks like the taint checking is causing the problem.
    
I know enough to know "you're supposed to use strict and -w", but
unfortunately the FAQs are less helpful on helping you make your program
work after you've done it.  Took me a while to figure out how to make it
work under taint checking (and apparently I don't have it figured out
yet).  Any helpful hints/places to look for more on that?

Thanks,
Ernest

-- 
Ernest C. Mueller                               ernestm@towery.com
Webmaster                                       Phone: (901) 251-7000
Towery Publishing                               http://www.towery.com


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

Date: Wed, 08 Jul 1998 12:11:46 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Problem in Variable String to Open()
Message-Id: <comdog-ya02408000R0807981211460001@news.panix.com>
Keywords: from just another new york perl hacker

In article <35A39456.A02468E3@towery.com>, Ernest Mueller <ernestm@towery.com> posted:

>work after you've done it.  Took me a while to figure out how to make it
>work under taint checking (and apparently I don't have it figured out
>yet).  Any helpful hints/places to look for more on that?

see the perlsec man page.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: Wed, 08 Jul 1998 12:43:14 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Protecting a HTML
Message-Id: <fl_aggie-0807981243140001@aggie.coaps.fsu.edu>

In article <6o03h9$9b2$1@newton2.pacific.net.sg>, "Chin Heng Wee"
<chinhw@postone.com> wrote:

+ With a tight deadline and low budget, I
+ cannot afford the time or man power to understand the problem thoroughly.
+ Just enough to help me to complete my task. Hope that you understand.

Server security requires more than this. Too bad your client doesn't
understand that...

James


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

Date: 8 Jul 98 14:08:17 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Quaintness involving the /x modifier, a comment and slash...
Message-Id: <slrn6q76rd.vj.sitaram@ltusitaram.diac.com>

On 06 Jul 1998 13:56:28 -0600, Tkil <tkil@scrye.com> wrote:

>Abigail already ran across this one, and reported it about a month
>ago:
>
>   http://www.rosat.mpe-garching.mpg.de/mailing-lists/perl-porters/1998-06/msg01068.html
>
>the final outcome was basically a doc patch:
>
>   http://www.rosat.mpe-garching.mpg.de/mailing-lists/perl-porters/1998-06/msg01218.html
>
>which can be distilled to: "be careful about putting pattern
>delimiters into comments when you do /x-style regexps."

I had the opposite problem a while ago.  I was using extended
regexes and needed a "#" as part of the pattern itself.  Where
normally that wouldn't need to be escaped (if not using /x), I had
to use "\#" instead.

Perhaps that should go into the docs as well...?  I don't know -
to me it seems obvious that you'd need to backwhack the pound, but
then I think, perhaps that's the clarity of hindsight!


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

Date: 8 Jul 1998 16:24:48 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Save attachment as a seperate file
Message-Id: <6o06gg$bgo$1@news.iastate.edu>

biaolu@my-dejanews.com wrote:
: I am try to write a Perl program which will save my unix e-mail attachment as
: a  new file yet keep the original format. For example, I may receive a mail
: from someone that attached his resume as a .doc file, the program should save
: the attached file as a .doc file but seperately. Any idea? Thanks!

Unless you want to write code to decode the MIME crap and save the
attachment, this isn't a perl question.

If you're on a unixlike machine I suggest installing mh, and then
using "mhn -store msg-num." Of course, there are plenty of other
methods, depending on your mail agent.



Josh

--

__________________________________________
She had heard all about excluded middles;
they were bad shit, to be avoided.
            - Thomas Pynchon



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

Date: Wed, 08 Jul 1998 16:51:16 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Searching a file
Message-Id: <35A39574.905D173F@nortel.co.uk>

David Hamilton wrote:
> 
> I am having some problems loading a text file into a variable and then
> not writing to the file if an E-mail address is already in the file.  I
> have read all the documentation I could find on this.  This code writes
> to the file no matter what and there are many occurences of $email
> already in the file.

I believe you're only reading the first line of the file.

open (REMOVED, "+< removed.txt");
BLOCK: {
  while (<REMOVED>) {
    /$email/ && last BLOCK;
  }
  print REMOVED "$email\n"
}
close (REMOVED);


This code is untested, but hopefully does what you want!

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Wed, 8 Jul 1998 12:24:04 +0100
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: serious bug in Time::Local?
Message-Id: <19980708.122404.5k7.rnr.w164w@locutus.ofB.ORG>

kh052@cks1.rz.uni-rostock.de (Kajetan Hinner) writes:

> $time1=timelocal(0,0,5,31,3,1998);
> $time2=timelocal(0,0,5,1,4,1998);

is this a 0=Jan 3=Apr 4=May problem?

> please answer also via mail

the `Mail-Copies-To: poster' header would have done this.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: Wed, 8 Jul 1998 17:46:08 GMT
From: abw@cre.canon.co.uk (Andy Wardley)
Subject: Text::MetaText Features 
Message-Id: <EvsEox.8A5@cre.canon.co.uk>


#========================================================================
#
# Text::MetaText 
#
#   Version 0.20
# 
#   Copyright (C) 1996-1998 Andy Wardley <abw@kfs.org>.  
#   All Rights Reserved.
#
#------------------------------------------------------------------------
#
# Features
#
#   This file gives a general overview of the features of Text::MetaText.
#   Considering, in particular, the number of various text/template 
#   processing modules available in CPAN, this file should help the 
#   potential user determine if the module is suitable for their needs.
#
#   A brief description of some of the other text/template processing 
#   modules available follows the Text::MetaText features list.
#
#========================================================================

MetaText is a (yet another) text processing and markup meta-language 
which can be used for processing "template" files. 

Like a glorified pre-processor, MetaText can; include files, define 
and substitute variable values, execute conditional actions based on 
variables, call other perl functions or object methods and capture the 
resulting output back into the document, and more. It can format the 
output of any of these operations in a number of ways. The 
objects, and inherently, the format and semantics of the MetaText 
langauge itself, are highly configurable.

MetaText does *not* evaluate any code using perl's 'eval' function.
This makes it safe to use in an environment where the input cannot
be verified or trusted.  The implications of a malicious (or possibly 
accidental) directive in a document are serious:

    Some document, blah, blah, blah
    %% system('rm -fr *') %%       # not a problem with MetaText
    more generic document stuff, blah, blah
  
On the other hand, a text processing system that allows embedded perl 
programs to be executed is naturally far more powerful.  MetaText is not 
that beast.  There are several other modules which perform that task 
admirably, as described in the final section below.

What MetaText benefits from this approach is that the syntax is greatly
simplified.  Web Designers, for example, who have no knowledge of perl
or desire to learn (shame on them!) can quite happily use MetaText to 
markup template documents and rely on its limited but powerful range of 
features to get the job done quickly and well.  MetaText supports a 
number of directives that have functionality "built in" such as 
INCLUDE which processes and inserts the contents of an external file.

When the default MetaText command set simply isn't enough, an EXECUTE 
configuration flag can be set to allow externally defined functions or 
class methods to become part of the syntax.  In this way, it is possible
to extend MetaText quickly and easily to execute any arbitrary perl in a 
safe and restricted manner.


#------------------------------------------------------------------------
# About MetaText
#------------------------------------------------------------------------

* MetaText is written entirely in Perl 5.

* MetaText is free software.  You are free to use, distribute and modify
  it under the terms of the Perl Artistic License.

* MetaText is fully object-oriented and does not pollute the caller's
  namespace.

* MetaText is well documented and the code is thoroughly commented.
  An ever-growing test suite is included to test the processor and 
  provide user examples.

* MetaText is beta-test software but is reliable and roadworthy.  
  It has been developed and tested over a number of years and is now 
  generally very stable.  
  
* The interface _may_ change in future versions.  It is for this reason 
  that MetaText is still "in beta".  Every effort has, and will be made
  to maintain backwards compatibility.  No major interface changes are
  planned that will not be backwardly compatible.

* MetaText is '-w' and 'use strict' compliant.

* MetaText is Y2k compliant, however nonsensical that notion may be.


#------------------------------------------------------------------------
# Feature Summary
#------------------------------------------------------------------------

* Text files and strings can be processed and any embedded directives 
  are expanded.

* Directives may be placed anywhere in a text file or string and are
  enclosed in 'magic' tokens which may be user-defined tokens 
  (default: '%%'):

    some text, blah, blah, %% INCLUDE some/file %% yah, yah, yah
    with user-defined tokens:  <!-- INCLUDE some/file --> etc., etc

* Directives may contain any whitespace, including blank lines:

    %%
        INCLUDE foo/bar

        var1 = valA
        var3 = valB
        no_space=no_problem
    %%

* Significant whitespace should be quoted

    %% INCLUDE me
       name = "Andy Wardley"
    %%

* Directive names may be specified in either case (although UPPER CASE
  is recommended for clarity)

    %% INCLUDE foo %%
    %% include bar %%

* Variables can be defined in the calling perl code or within a 
  template document itself:

    %% DEFINE foo=bar baz="A string" %%

* Variables can be interpolated into the document:

    %% foo %%   (the verbose version is '%% SUBST foo %%')

* Variables can be interpolated into other variables:

    %% DEFINE rootpath=/home/abw       %%
    %% DEFINE imgpath=$rootpath/images %%

* Variable names can be treated case sensitively or insensitively 
  (default).

    %% DEFINE config="-vaf" %%
    %% config %%  %% CONFIG %%  %% Config %%   # all OK by default

* The INCLUDE directive can be used to import (and process) other files:

    %% INCLUDE header %%

* Directives (including INCLUDE) can be nested inside other files.

* Variables can be used to specify the INCLUDE filename:

    %% DEFINE header=abw/graphics/header %%
    %% INCLUDE $header %%

* A 'LIB' configuration variable specifies one or more directories where
  included (via INCLUDE) files are to be found.  Absolute file paths can 
  also be specified.

* Additional variable definitions can be added to an INCLUDE directive.
  All variable values are inherited by sub-documents (as per SGML/XML, 
  etc) and changes are locally scoped.

    %% INCLUDE my_html_header
       title   = "My Home Page"
       bgcolor = "#ffffff"
    %%

* BLOCK elements can be defined within a document to avoid having to 
  INCLUDE a separate file:

    <table>
    %% INCLUDE table_line id=tom name="Thomas Trumpton" %%
    %% INCLUDE table_line id=dic name="Richard Chigley" %%
    </table>

    %% BLOCK table_line %%
    <tr>
        <td>%% id %%</td>
        <td>%% name %%</td>
    </tr>
    %% ENDBLOCK %%

* All variable specification and interpolation options apply equally to 
  '%% INCLUDE <block> %%' directives as to '%% INCLUDE <file> %%'.

* The parsed contents of include files and defined blocks are cached
  internally to increase the speed of repetitive processing.  This gives 
  a significant performance boost, particularly when processing multiple 
  files or when using a persitant MetaText object (as you might with 
  mod_perl, for example).

* the content of blocks can be pre-declared by a calling script (i.e. 
  pre-caching).

* Complex conditional statements can be specified in INCLUDE directives
  to specify (at 'run-time') if the file or block should be included or
  ignored:

    %% INCLUDE myfile 
       if = "xyz < $max && (name =~ /Wardley/ || id in 'tom,dick,harry')" 
    %%

* 'unless' is similar, but negates the evaluation:

    %% INCLUDE higfx/header unless=textmode %%

* Standard and user-definable filters can be used to post-process the 
  contents of included files or blocks:

    %% INCLUDE myfile
       filter = escape(['])
    %%

    %% INCLUDE myblock
       filter = my_own_filter(param1, param2, etc)
    %%

* printf-like formats may also be specified for post-processing

    %% INCLUDE myfile
       format = "## %72s ##"
    %%

* An __END__ or __MTEND__ marker can be placed in the input text to mark
  the point at which processing should stop.  Certain MetaText directives
  (such as BLOCK...ENDBLOCK definitions) can be specified after this 
  point and incorporated into the document proper.

    %% INCLUDE myblock %%

    __MTEND__
    %% BLOCK myblock %% This is my block %% ENDBLOCK %%

* The EXECUTE configuration options allows class methods and perl 
  functions to be executed as directives.  Variables can be defined 
  in the normal way and get passed to the function as a hash reference:

    %% my_function 
       name = Fred
       age  = 42
    %%
  
* MetaText has user-definable error reporting and a comprehensive
  debug facility.

* MetaText is ideally suited to web content creation for both 
  static (processed off-line) and dynamically generated web pages, as 
  well as many other tasks.  


#------------------------------------------------------------------------
# The 'metapage' Processor.
#------------------------------------------------------------------------

The 'metapage' processor is a utility script that is distributed as part
of the Text::MetaText package (in the distribution 'bin' directory and 
installed to your perl bin directory when you 'make install').  

It may be convenient to think of metapage as the MetaText equivalent of 
make(1S), but nicer.  :-)

* Versatile configuration allows multiple profiles to be defined and 
  incorporated easily.

* MetaText configuration items and pre-defined variables can be specified
  in metapage config files.

* Numerous command-line options are available to tailor behaviour.

* Can traverse document trees examining time stamps to determine which 
  files should be processed.



#========================================================================
#
# Other Text/Template Processing Modules
#
#   This section lists some of the other text/template processing 
#   modules available from CPAN.  This list is not comprehensive either 
#   in the number of modules included, or in the detail in which they are 
#   described.  
#
#   As the author of Text::MetaText, I am naturally enamoured to my own 
#   solution and as such, my opinion is likely to be biased.  I have 
#   tried to briefly summarise the key features of each module as I 
#   understand them, but I would urge the reader to examine the 
#   relevant documentation in detail to get the full picture.
#
#   I welcome corrections and additions from the modules' authors or 
#   indeed anyone else who has a more comprehensive understanding of 
#   these packages than I.
#
#========================================================================

#------------------------------------------------------------------------
# Parse::ePerl by Ralf S. Engelschall <rse@engelschall.com>
#------------------------------------------------------------------------

ePerl interprets an ASCII file bristled with Perl 5 program
statements by evaluating the Perl 5 code while passing through
the plain ASCII data.  ePerl is an ANSI C program that actually
embedds a perl processor within itself.  Code within '<: ... :>'
blocks is evaluated and all other text is passed through.

Example:
    #!/path/to/eperl
    foo bar
    baz quux
    <: for ($i = 0; $i < 10; $i++) { print "foo #${i}\n"; } :>
    foo bar
    baz quux

See:
    http://www.engelschall.com/sw/eperl/


#------------------------------------------------------------------------
# Text::Vpp by Dominique Dumont <Dominique_Dumont@grenoble.hp.com>
#------------------------------------------------------------------------

A fast and lightweight pre-processor which is a suitable replacement
for cpp or m4.  Supports @INCLUDE, @EVAL, @IF, @ELSIF and @ENDIF 
statements.  Statements must be placed at the start of a line but may
be prefixed with any user-defined character.  Includes a 'vpp' 
script which encapsulates the module for processing files directly
from the command line.

Example:

    @INCLUDE inc_text.txt
    @EVAL $var2 = 1
    @IF $var2
    We should see this line
    @ELSE
    But not this one
    @ENDIF
     

#------------------------------------------------------------------------
# Text::Template by Mark-Jason Dominus <mjd@pobox.com>
#------------------------------------------------------------------------

A generic template processing module which allows tiny perl programs
to be embedded in text files.  When a template is filled in, the perl
programs are evaluated, and replaced with their values.  Simple and 
fast yet versatile.

Example:
 
    Dear {$title} {$lastname},
      
    It has come to our attention that you are delinquent 
    in your {$last_paid_month} payment.  Please remit 
    ${sprintf("%.2f", $amount)} immediately, or your patellae 
    may be needlessly endangered.
   

--
Andy Wardley <abw@kfs.org>   Signature regenerating.  Please remain seated.
     <abw@cre.canon.co.uk>   For a good time: http://www.kfs.org/~abw/


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

Date: Wed, 8 Jul 1998 17:44:30 GMT
From: abw@cre.canon.co.uk (Andy Wardley)
Subject: Re: Text::MetaText Re: methods to insert/substitute blocks of text?
Message-Id: <EvsEM6.88y@cre.canon.co.uk>

Dan Baker  <dtbaker_@flash.net> wrote:
>looks like a good possability, I'll have to go read more about it...
>Andy, please feel free to expound on the package's many pros and ease of
>use for all of our education of course!  ;)


OK.  I have this:

 ~abw/web/lib/header
       <html><head>%% title %% </head><body bgcolor="%% bgcolor %%">
       etc., etc., etc., 
        
and this:

 ~abw/web/lib/footer
       last modified, blah, blah, copyright, etc.1
       </body>
       </html>

and I have all sorts of files that look like this:

  ~abw/web/src/foobar.html
      %% INCLUDE header
         title   = "This is a text page"
         bgcolor = "#ffffff"
      %%

      blah, blah, here's the content...

      %% INCLUDE footer %%

I have a configuration file which looks something like this:

  ~abw/.metapagerc

     [file]
     src     = ~abw/web/docs
     lib     = ~abw/web/lib
     dest    = ~abw/public_html

     [define]
     # common URL roots
     root    = /~abw/kfs
     images  = $root/images
     cgibin  = $root/cgi-bin
     name    = "Andy Wardley"
     bgcolor = "#ffffff"

I run:

   "metapage"

and it trawls through my source directory, looking for any files that have
been modified, processes them using the template element files in my lib
directory and copies the output to my public_html directory.

If I want to use a different set of elements (say text-only headers), I can
use a different config file (specify on the command line) which might create
an entirely different output tree from the same input source.

So far, no perl.  

If I want to use it in a CGI script....

   #!/path/to/perl

   use Text::MetaText;

   my $mt = Text::MetaText->new();  # all sorts of config items

   $mt->process_file($file, \%vars);   
   $mt->process_text($text, \%vars);


If I want to create me own template "directives" I can do this:

   package MyMetaText;
   use vars qw(@ISA);
   @ISA = qw(Text::MetaText);

   sub do_something_really_clever {
       my $self = shift;
       my $vars = shift;

       .....
   }

and then I can use it:

   my $mt = MyMetaText->new({ EXECUTE => 1 });
   $mt->process_file($file);

which will allow me to put this in my template files:

   %% INCLUDE header %%

   %% do_something_really_clever  var1 = val1   var2 = val2  %%

   %% INCLUDE footer %%
  
and have the methods called.


That quickly highlights some of the key features.  I'll post the complete 
"Features" file in another message.


A


--
Andy Wardley <abw@kfs.org>   Signature regenerating.  Please remain seated.
     <abw@cre.canon.co.uk>   For a good time: http://www.kfs.org/~abw/


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

Date: 8 Jul 1998 17:21:46 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: tough regexp - help needed
Message-Id: <6o09ra$pj8$2@client3.news.psi.net>

otis@my-dejanews.com (otis@my-dejanews.com) wrote on MDCCLXXII September
MCMXCIII in <URL: news:6nvtc8$rot$1@nnrp1.dejanews.com>:
++ In article <6nufuq$fjc$5@client3.news.psi.net>,
++   abigail@fnx.com wrote:
++ > otis@my-dejanews.com (otis@my-dejanews.com) wrote on MDCCLXXI September
++ > MCMXCIII in <URL: news:6nu75i$fc8$1@nnrp1.dejanews.com>:
++ > ++ Hello,
++ > ++
++ > ++ perl regular expression problem :)
++ > ++
++ >
++ > (Something with HTML)
++ >
++ > Don't apply regexs on the entire document - that won't work.
++ >
++ > use HTML::Parser;
++ 
++ unfortunately this is not an option for me in this project.
++ while I posted this in a perl newsgroup (because it requires knowledge of
++ regular expressions, and a perl newsgroup is most probably the best for that),
++ the code is actually java (OROMatcher package).

But you wrote "perl regular expression problem".

++ So my original question still stands :)


Doesn't Java have a system() or equivalent command?



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: 8 Jul 98 14:08:21 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: What are "callbacks"?
Message-Id: <slrn6q774e.vj.sitaram@ltusitaram.diac.com>

On 6 Jul 1998 17:49:40 GMT, Craig Berry <cberry@cinenet.net> wrote:
>k y n n (NOSPAMkEynOn@panix.comNOSPAM) wrote:
>: What are "callbacks"?  I keep running into the term but I haven't been
>: able to find a definition.
>
>A programming idiom wherein a resource accepts from calling code
>references to functions to be called when some resource event occurs.  The
>function passed in, which is called by the resource when the event occurs,
>is often refered to as a 'callback', as are the process of calling the
>function, and the overall design model. 
>
>An example might be a GUI interface which would allow creation of an

A simpler example, IMHO, is the sort command in Perl.  The second
parameter is the name of a subroutine that the user supplies,
which sort "calls back" to do the comparision.


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3097
**************************************

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