[24462] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6645 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 2 14:05:57 2004

Date: Wed, 2 Jun 2004 11:05:06 -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, 2 Jun 2004     Volume: 10 Number: 6645

Today's topics:
    Re: Am I a programmer or a scripter ? <aldric.l'hernault@freescale.com>
    Re: create tables in pdf using perl (Mohamed Parvez)
    Re: CSV dB script help <jameskorea2003@hotmail.com>
    Re: CSV dB script help <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: CSV dB script help <tadmc@augustmail.com>
    Re: CSV dB script help <dwall@fastmail.fm>
        graphing link list nodes...  modules? (hennessy)
    Re: graphing link list nodes...  modules? <usenet@morrow.me.uk>
    Re: help with tk programming <gnari@simnet.is>
        HTML::Summary problem (Lee)
    Re: Initiate perl script in linux from a Windows VBA pr (b wreath)
    Re: Initiate perl script in linux from a Windows VBA pr <usenet@morrow.me.uk>
    Re: Invisible Array Loop Counter? <tadmc@augustmail.com>
        Range operator and odd numbers <roger1023@yahoo.com>
    Re: Range operator and odd numbers <richard@zync.co.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 02 Jun 2004 17:31:05 +0200
From: Aldric L'Hernault <aldric.l'hernault@freescale.com>
Subject: Re: Am I a programmer or a scripter ?
Message-Id: <c9krvt$3hq$1@newshost.mot.com>

Tintin wrote:
> A programmer is a person who uses a language that has a lot of marketing
> hype and/or costs a lot of money.
> 
> A scripter is a person who couldn't give a fig if he/she programs or
> scripts, just so long as they use the right language for the job.


I love your definition, but it has to be completed:

Scripting is leaving clean open source as text file, whereas programming 
is mainly obfuscating messy code behind any kind of binary format.

Else why wouldn't all source code being released in public domain ? 
Programmers are scared not so about their code being stolen, but overall 
about it being criticized ;)

Hope programmers have a wide sens of humor ;)

Aldric






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

Date: 2 Jun 2004 08:10:44 -0700
From: parvez@gmail.com (Mohamed Parvez)
Subject: Re: create tables in pdf using perl
Message-Id: <f86738db.0406020710.6024c96@posting.google.com>

Hello All,
          After many days of R&D and many suggestions, I have come to
conclusion to develop tables inside PDF, using
http://denature.sourceforge.net. That is I will create HTML files and
make tables inside it (I know HTML well compared PS and LaTeX). Then
using denaute I will convert that document to pdf.

Do let me know if you don't think this is a good approach 

          Thanks for all your valuable suggestions 

Regards,
Mohamed Parvez 


parvez@gmail.com (Mohamed Parvez) wrote in message news:<f86738db.0405202138.26f8157a@posting.google.com>...
> well i did that the first thing. But i could not find any module that
> would let me create tables inside a pdf
> 
> "J. Gleixner" <glex_nospam@qwest.invalid> wrote in message news:<035rc.66$QZ6.20350@news.uswest.net>...
> > Mohamed Parvez wrote:
> > > Hello All,
> > > 
> > > Is there any perl module that will let me create tables inside pdf document?
> > > 
> > > I need to create reports in table format in a pdf file 
> > > 
> > > If some examples can be provided it will be great 
> > 
> > Whenever you have a. "Is there any perl module that will...", question,
> > always start by searching CPAN:
> > 
> > http://search.cpan.org/
> > 
> > Examples are typically included with the module's documentation.


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

Date: Wed, 2 Jun 2004 09:48:43 -0600
From: "James Hunt" <jameskorea2003@hotmail.com>
Subject: Re: CSV dB script help
Message-Id: <-bqdnetOUNhVayDdRVn-vw@comcast.com>

I am sorry about the lengthy post.  It will not happen again.

--
JAMES HUNT
"James Hunt" <jameskorea2003@hotmail.com> wrote in message
news:C7idnWmMlvVCzSDdRVn-jw@comcast.com...
> Ok this is kinda long ... so i will get to the point ... A friend of mine
> started perl script to handle a csv database.  And now I am trying to
finish
> it.  I am currently working on the search records feature.  For some
reason
> it always returns all of the records.  I have dug through to code and I
can
> not seem to figure out why it returns all of the records.  at the bottom I
> have included the script .....  the search form ... and then the csv file
> that i built as a test.
>
> Even some perldoc references will help.
>
> Thanks,
> James Hunt
>
> ---------- database_script.pl ----------
> #!/usr/bin/perl
>
> #################################################################
> # This script is used toread a spreadsheet in csv format and perfom querys
> on arbitrary data sets.
> # The form submitted to this will use the name of the fields as the keys
for
> searches.
> # It uses the order of those keys for the order it displays them.
> # This sscript assumes that any 6 #'s are dates in YYMMDD format This is
> done in the useredit
> # and the quicksort.
> # Current Bugs: Need to be able to sort by other than numbers, Need
validity
> set to "D" for users,
> # Need click on CASN for other search, and user edit.
> # Original Author: Joshua Olson
> #################################################################
>
> use CGI ':all';
>
> # The path and file name must be passed as the first two element in a
comma
> group.
> # i.e. ....scriptname.pl?/path/,file_name.csv
> # $param[0] is the path name
> # $param[1] is the file name
>
> $searchpage = "query.html";
>
> @params = split(/\,/,$ENV{'QUERY_STRING'});
> my(@data)=loadtable($params[0],$params[1]);
>
> # Start off with everything and whittle down from there.
>
> my(@match)=(0..$#data);
>
> # Default Header line for html pages.
>
> print header('text/html');
>
> # $params[2] is the all purpose item
>
> if(!$params[2] || $params[2] =~ /edit/i || $params[2] =~ /search/i)
> {
> search(\@match,\@data);
> }
> elsif($params[2] =~ /update/i)
> {
> update(\@data,$params[0],$params[1]);
> print "Update Elsif Has Arrived";
> }
>
> # If there isnt anything else being done then sort on the key.
>
> elsif($params[2])
> {
> quicksort($params[2],3, $#params, \@match, \@data);
> }
>
> # Login Check For Updating
>
> if($params[2] =~ /edit/i || $params[2] =~ /update/i)
> {
> if($params[3] eq "user" && $params[4] eq "passwd")
> {
> # Superuser Edit
> printpage(\@match, \@data,'edit');
> }
> else
> {
> # User Level Edit
> printpage(\@match, \@data,'useredit');
> }
> }
> else
> {
> # If no edits then display data normally
> printpage(\@match, \@data, '');
> }
>
> #################################################################
> # sub update #
> # #
> # The subfunction takes the input from the form created by the #
> # printpage() sub and prepares the date for the writeupdate() #
> # sub. #
> # #
> # You pass $array by ref and the $dir and $file strings and the #
> # form from printpage() was submitted. #
> # #
> # This sub results in extracting all the entries to update and #
> # updated them in the array then called the writeupdate() and #
> # wrote them to $dir$file. #
> # #
> #################################################################
>
> sub update
> {
> # We need the array, so that memory isnt wasted
> my($array,$dir,$file)=@_;
>
> # Get the names of the fields
> @fields=param();
>
> # New Blank Entry
> @toupdate= ();
>
> # The last one is far undefined
> $last=-1;
>
> # Pull the numbers out of each of the field names
> foreach $i(@fields)
> {
> # This is what actually pulls it out
> $i =~ /\s(\d+)/;
>
> # No need to duplicate these numbers
> if($last != $1)
> {
> # Push it into the array
> push @toupdate,$1;
> }
>
> # Make sure we do not dup, so update last
> $last=$1;
> }
>
> # Now do the update to the array
> foreach $num(@toupdate)
> {
> foreach $imakey(@key)
> {
> # Same keys just a different format
> $$array[$num]{$imakey}=param("$imakey $num");
> }
> }
>
> writeupdate($array,$params[0],$params[1]);
> }
>
> #################################################################
> # sub writeupdate
> #
> # This takes the entire array and writes it to a file in csv
> # format.
> #
> # This passes a ref to the array and, the $path ending with a
> # "/" and the $filename in theory it's .csv, but as long as
> # it's in the format it doesn't matter what you call it.
> #
> # This sub results in $dir$file being written to.
> #
> #################################################################
>
> sub writeupdate
> {
> my($array,$dir,$file)=@_;
>
> # Open it or die with custom error
> open(UPDATEME,">$dir$file") || die "Cannot Open $fname for Writing: $!";
>
> # Select the file for writing
> select(UPDATEME);
>
> # Print the keys (col names)
> print join(',',@key);
> print "\n";
>
> # Print the entry
> foreach $imakey(@key)
> {
> # Do each key
> foreach $imakey(@key)
> {
> print $$array[$i]{$imakey}.',';
> }
> print "\n";
> }
>
> select(STDIO);
>
> # Close that file down
> close(UPDATEME);
> }
>
> #################################################################
> # sub quicksort
> #
> # This passes the numbers first, last the string (which is what
> # we will sort by) and the ref to arrays list and array where
> # list is what we're sorting.
> #
> # Results in a sorted list
> #
> #################################################################
>
> sub quicksort
> {
> # Get the variables we need
> my($key,$first,$last,$list,$array)=@_;
>
> # If they are eq then sort is done
> if($first<$last)
> {
> # Need to divide the array into pieces
> $cuthere = partition($key,$first,$last,$array);
>
> # Recursively continue until done
> quicksort($key,$first,$cuthere-1,$list,$array);
> quicksort($key,$cuthere,$last,$list,$array);
> }
>
> # Return in the new order
> @$list=@params[$first..$last];
> }
>
> #################################################################
> # sub partition
> #################################################################
>
> sub partition
> {
> my($key,$first,$last, $array)=@_;
>
> #Get the last one comparing
> $x=$$array[$params[$last]]{$key};
> chomp($x);
>
> #Start early so when you add one it's at the beginning
> $i=$first-1;
>
> #Check em all, the first to the almost last, last one is the key.
> for $j($first..$last-1)
> {
> #How can we tell that it is a date?
> #This doesnt work Right now.
> if($key eq "this is a date????")
> {
> #pull out the value for this entry and chomp it
> $temp=$$array[$params[$j]]{$key};
> chomp($temp);
>
> #rip $x apart!
> #assuming the format YYMMDD
> $temp =~ /(\d\d)(\d\d)(\d\d)/;
>
> $xyear =$1;
> $xmon = $2;
> $xday = $3;
>
> #rip $temp apart!
> #assuming the format YYMMDD
> $temp =~ /(\d\d)(\d\d)(\d\d)/;
>
> #If the year is higher than the year we're looking for it's a match
> if ($1 > $xyear)
> {
>
> }
> #Otherwise we need to look at the month
> elsif ($1 == $year)
> {
> #Same here as long as it's higher
> if($2 > $mon)
> {
>
> }
> #Same month? keep going
> elsif($2 == $mon)
> {
> #so, now $1==$year && $2==$mon, so day has to be greater
> if($3 >= $day)
> {
> #I get the feeling I should do something here.....
> }
> }
> }
> }
> #Sure, it sorts numbers, but can it julian fries!?
> #Still need strings!!!
> if ($$array[$params[$j]]{$key} <= $x)
> {
> $i++;
> #SWITCH!
> ($params[$i],$params[$j])=($params[$j],$params[$i]);
> }
> }
> $i++;
> #Now put the last one in it's place!!!
> ($params[$i], $params[$last]) = ($params[$last], $params[$i]);
>
> #Return where last now is
> return $i;
> }
>
> #################################################################
> # sub search #
> #################################################################
> sub search
> {
> #Need my variables
> my($match,$table)=@_;
>
> #The search keys that were sent by the form. These keys must match the
keys
> in the table file
> #exactly (i.e. NAME != Name)
> if(param())
> {
> my(@skeys) = param();
> }
> else
> {
> print "HELLO";
> my(@skeys) = $params[3];
> }
>
> #Do a search on each key sent
> foreach $key(@skeys)
> {
> if(param($key) ne "" && !(param($key) =~ /submit/i || param($key) =~
> /edit/i))
> {
> #This is the value of the key sent
> $temp = param($key);
>
> #Replace all spaces with ntohing hte g is for greedy...or global if you
> wanna be boring
> $temp =~ s/ //g;
> $temp =~ s/\*/.*/g;
> $temp =~ s/\?/./g;
>
> #In case they're searching ultiple items in a string
> @item = split (',',$temp);
>
>
> #Once for each item
> for $i(0..$#item)
> {
> #Go through each onestill left in the list
> #If it's the first time, the whole list is still here.
> for $j(@match)
> {
> #Match the pattern, don't see if they're equal
> #Do ranges?
> if($$table[$j]{$key} =~ /^$item[$i]/i)
> {
>
> #If it matches put in into the array
> push (@matches,$j);
> }
> }
> }
> #All our temp matches are now allt he matches that still work
> @$match=@matches;
> }
> }
> }
>
> #################################################################
> # sub loadtable
> #################################################################
> sub loadtable
> {
> #Read the variables
> my($dir,$file)=@_;
> my(@table);
>
> open(FILE,"<$dir$file") || die "Cannot open $fname for reading:$!";
>
> #Read the first line because that has all the column names
> $line = <FILE>;
>
> #Get rid of the windows end lines
> chomp($line);
> chop($line);
>
> #These names will be our keys
> @key =split(',',$line);
> #This reads in each line of the file starting with the second line
> while(<FILE>)
> {
> #Ger rid of windows end lines
> chomp();
> chop();
>
> #Make sure there's something we want (Anything) in this line
> if(!($_ =~ /[\d\w]/))
> {
> next;
> }
>
> #Stick it into an array and break it at the commas
> @line=split(/,/);
>
> #force entry to have anon hash for each line
> #very important otherwise everything will have the same values
> $entry = {};
>
> #Stick those elements into the proper key.
> for $i(0..$#line)
> {
> #Check for quoted spots, they're just one entry inside the quotes even if
> there's commas
> #And drop the double quote, we don't need it anymore
> if($line[0]=~ s/\"//)
> {
> #Well we know there's at least two parts,the first quote and the second
> $entry->{$key[$i]}= shift @line;
> for $j(0..$#line)
> {
> #Keep an eye out for that second quote
> if($line[0]=~ s/\"//)
> {
> #If we find it we're done with this loop.
> $j=$#line;
> }
> #Hehehe, Guess we got a little happy removing comma's, so now we need to
put
> some back in
> $entry->{$key[$i]}.= ',';
> $entry->{$key[$i]}.= shift @line;
> }
> }
> else
> {
> #Shift is very useful!
> $entry->{$key[$i]}= shift @line;
> }
> }
> #So, is push. Add that new line onto the end of the array
> push @table, $entry;
> }
> close(FILE);
>
> #This gives the whole file back now that it's in an easily accessable (and
> searchable) format
> return @table;
> }
>
> #################################################################
> # sub printpage
> #################################################################
> sub printpage
> {
> my($matches,$table,$edit)=@_;
>
> print <<HEAD;
> <html>
> <head>
> <title>Query Results</title>
> </head>
> <body bgcolor="#809CAA">
> <a href="$searchpage">Return to query</a>
> <table align=center border=1.
> <tr align=center>
> HEAD
>
> #If you're editing you need a form
> if($edit){
> print "<form action=\"$ENV{'SCRIPT_NAME'}?$params[0],$params[1],UPDATE\"
> method=post name=\"edit\">";
> }
> #And you need if you're a guy with a password you can add new entries
> if($edit eq "edit")
> {
> printrow ($#$table+1,$table,$edit);
> }
> #We need to know what col's what so printout the names
> foreach $colname (@key)
> {
> #If we're not editing let them do a sort on them too.
> if($edit eq "edit")
> {
> #Making it pretty too, if somone reads the source in the browser
> print "\t\t\t<td>$colname</td>\n";
> }
> else
> {
> #Can't pass spaces in the address line so make 'em into +es
> $as_param=$colname;
> $as_param =~ s/ /+/g;
>
> #Call itself in for the sort.
> print"\t\t<td><a
> href=\"$ENV{'SCRIPT_NAME'}?$params[0],$params[1],$as_param";
>
> #Note: These #'s are the number's of the entry not any value of the table
> #This adds all the elements in our matches to the address line and those
are
> what's sorted on
> foreach $i(@$matches)
> {
> print ','.$i;
> }
> #Now actually print the name of the col
> print"\">$colname</a></td>\n"
> }
> }
>
> print "\t</tr>\n";
>
> #Print all those entries that matched
> foreach $i(@$matches)
> {
> printrow ($i,$table,$edit);
> }
>
> #Again if we're editing then we need a button to submit the changes
> if($edit eq "edit") {
> print "<input type=submit name=submit value=Udate></form>";
> }
>
> print "</table>\n</body>\n</html>";
>
> }
>
> #################################################################
> # sub printrow
> #################################################################
> sub printrow
> {
> #Get those variables
> my($entry,$table,$edit)=@_;
>
> print "\t</tr>\n";
>
> #Go through and write in the order of the keys
> foreach $j(@key)
> {
> print "\t\t<td>\n";
>
> if($edit)
> {
> print "\t\t\t<input type=\"text\" name=\"$j $entry\" length=6
> value=\"$$table[$entry]{$j}\">\n";
> }
> else
> {
> print "\t\t\t<a
>
href=\"$ENV{'SCIPT_NAME'}?$params[0],$params[1],SEARCH,$$table[$entry]{$j}\"
> >$$table[$entry]{$j}&nbsp\;\n</a>";
> }
> print "\t\t</td>\n";
> }
> print "\t</tr>\n";
> }
>
> ---------- query.html ----------
> <html><head><title>Query Form</title>
> <script language=JavaScript>
> function login() {
> var login = prompt("What is your user name?","user");
> var password = prompt("What is your password?","passwd");
> document.forms['ednquery'].action+= ",EDIT,"+login+","+password;
> }
> </script>
> </head>
> <body>
> <form
action="database_script.pl?/Inetpub/wwwroot/cgi-bin/edndb/,dBdata.csv"
> method=POST name="dBquery">
> <table border=1 align=center>
> <tr align=center>
> <td>Number</td>
> <td>Name</td>
> <td>Status</td>
> </tr>
> <tr>
> <td><input type=text name="Number" size=5></td>
> <td><input type=text name="Name" size=10></td>
> <td><input type=text name="Status" size=10></td>
> </tr>
> <tr>
> <td><input type=submit name="submit" value="Submit"></td>
> <td><input type=reset name="clear" value="Clear"></td>
> <td><input type=submit name="submitedit" value="Edit"
> onClick="login();"></td>
> </tr></table>
> </form></body></html>
>
> ---------- dBdata.csv ----------
> Number,Name,Status,
> 55,Tom,M,
> 58,Ed,M,
> 53,Larry,O,
> 51,Bob,M,
>
>




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

Date: Wed, 2 Jun 2004 09:03:38 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: CSV dB script help
Message-Id: <qotk9c.opm.ln@goaway.wombat.san-francisco.ca.us>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

On 2004-06-02, James Hunt <jameskorea2003@hotmail.com> wrote:
> I am sorry about the lengthy post.  It will not happen again.

It just did, when you top-posted one line above 600+ of your
original lines.  Sheesh!

- --keith

- -- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAvfpXhVcNCxZ5ID8RAuzFAJ4iKjE34tytcF2ASOkGevqje9+H7ACdEF/4
d5VWSeW5JQmLfOW3RdHT/SM=
=jDsn
-----END PGP SIGNATURE-----


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

Date: Wed, 2 Jun 2004 11:07:26 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: CSV dB script help
Message-Id: <slrncbrupu.4gm.tadmc@magna.augustmail.com>

James Hunt <jameskorea2003@hotmail.com> wrote:

> I am sorry about the lengthy post.  


OK then.


> It will not happen again.


Are you joking!

You did it again in this very followup!

Stop it!


and please stop top-posting too.



[ snip 500 lines repeated yet again. Sheesh! ]


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


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

Date: Wed, 02 Jun 2004 16:23:39 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: CSV dB script help
Message-Id: <Xns94FC7E1491365dkwwashere@216.168.3.30>

James Hunt <jameskorea2003@hotmail.com> wrote:

> I am sorry about the lengthy post.  It will not happen again.

[snip top-posted full-quote of offending post]

You quoted the entire thing and then apologized for it being such a 
long post? 

That's like screaming into someone's ear, and then screaming into their 
ear, "I'M SORRY, I WON'T DO THAT AGAIN!"  :-)



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

Date: Wed, 02 Jun 2004 17:10:35 -0000
From: hennessy@earl-grey.cloud9.net (hennessy)
Subject: graphing link list nodes...  modules?
Message-Id: <10bs2gbgeebodaa@corp.supernews.com>

Hi,
	I need to put together a PNG or PDF chart using a linked list of
'nodes', and I was wondering if there were any modules that handled this
kind of thing already?  That is, if I had a listref of hashrefs like so:

	$nodes->[$entry]->{'id'}
	$nodes->[$entry]->{'parent_id'}
	$nodes->[$entry]->{'name'}
	$nodes->[$entry]->{'description'}

	I would feed it the LoH and tell it which keys to use as id and
parent id, and it would create graphics representing name & description
and arrows relating the relationships between the LoH nodes, say as
objects in a default layout which could be modified by object calls or
something.

	I'm thinking maybe this is too generic a problem, but if anyone 
can point me to a module or recipe I'd be terribly grateful...

	(oh yes, and perl.com seems down from my end and CPAN didn't have 
anything in search that was screamingly obvious)

Cheers!
- Matt

-- 
"When in doubt, use brute force."
- Ken Thompson


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

Date: Wed, 2 Jun 2004 17:20:15 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: graphing link list nodes...  modules?
Message-Id: <c9l28f$q1l$1@wisteria.csv.warwick.ac.uk>


Quoth hennessy@earl-grey.cloud9.net (hennessy):
> Hi,
> 	I need to put together a PNG or PDF chart using a linked list of
> 'nodes', and I was wondering if there were any modules that handled this
> kind of thing already?  That is, if I had a listref of hashrefs like so:
> 
> 	$nodes->[$entry]->{'id'}
> 	$nodes->[$entry]->{'parent_id'}
> 	$nodes->[$entry]->{'name'}
> 	$nodes->[$entry]->{'description'}
> 
> 	I would feed it the LoH and tell it which keys to use as id and
> parent id, and it would create graphics representing name & description
> and arrows relating the relationships between the LoH nodes, say as
> objects in a default layout which could be modified by object calls or
> something.
> 
> 	I'm thinking maybe this is too generic a problem, but if anyone 
> can point me to a module or recipe I'd be terribly grateful...

The module B::Graph uses an external program called 'dot' to generate
its graphs; you may find that useful. It will generate both ps and png
output (despite the manpage claiming it only produces gif).

http://www.research.att.com/sw/tools/graphviz/

Ben

-- 
It will be seen that the Erwhonians are a meek and long-suffering people,
easily led by the nose, and quick to offer up common sense at the shrine of
logic, when a philosopher convinces them that their institutions are not based 
on the strictest morality.  [Samuel Butler, paraphrased]       ben@morrow.me.uk


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

Date: Wed, 2 Jun 2004 15:43:35 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: help with tk programming
Message-Id: <c9ksfo$dd8$1@news.simnet.is>

"Paul Lalli" <ittyspam@yahoo.com> wrote in message
news:20040602071651.S8971@dishwasher.cs.rpi.edu...
> On Wed, 2 Jun 2004, gnari wrote:
>
> > "Avinash" <avishivani@rediffmail.com> wrote in message
> > news:50f061fc.0406020230.5a154c63@posting.google.com...
> > > Dear Sir,
> > > please help me getting started with tk programming on windows
platform.
> > >
> > > any book reference or site names will be welcome.
> >
> > google is your friend
> >
> > http://www.google.com/search?q=tcl+tk+windows+tutorial
> >
>
> Out of curiousity, why are you sending the OP posts about Tcl/Tk in a Perl
> newsgroup?  Would not a pointer to Perl/Tk be better?

I was just being mean. for that, I apologise.

gnari





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

Date: 2 Jun 2004 10:29:35 -0700
From: lee@mailinator.com (Lee)
Subject: HTML::Summary problem
Message-Id: <b95662b9.0406020929.2ea25b62@posting.google.com>

I've been trying to get a fairly simple (should be :) going.  Mostly a
cut and paste of what the give on the man page.  It keeps on coming up
blank for $summary:

    use HTML::Summary;
    use HTML::TreeBuilder;

    my $tree = new HTML::TreeBuilder;

	$tree->parse( 'rock.html' );
	   $tree->dump;
   print "\n" . $tree->as_HTML . "\n";
    my $summarizer = new HTML::Summary(
        LENGTH      => 200,
        USE_META    => 0,
    );
    $summary = $summarizer->generate( $tree );
print "Summary=" . $summary;

I'm a still a Perl newbie, so forgive the possible stupidity of this
question :)

btw rock.html exists in the same directory and I can open and read it
in Perl.  I'm running from command line and the modules are installed.

Lee


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

Date: 2 Jun 2004 08:45:23 -0700
From: bearwreath@yahoo.ca (b wreath)
Subject: Re: Initiate perl script in linux from a Windows VBA program
Message-Id: <4ce1b1cd.0406020745.5ba8e32c@posting.google.com>

Ben Morrow <usenet@morrow.me.uk> wrote in message news:<c8apvd$238$1@wisteria.csv.warwick.ac.uk>...
> Quoth bearwreath@yahoo.ca (b wreath):
> > I would appreciate help with the following.  I would like to be able
> > to initiate a perl script that is residing on a linux server from an
> > Excel workbook.  I am working on the Excel workbook in Windows. I
> > would appreciate any pointers, sample code for accomplishing this in
> > VBA or some other method.
> > 
> > The perl script that I am trying to call will take the information from the
> > from a mysql database and update the Excel sheet.  The script will also take
> > information from the Excel sheet and update the database.
> 
> Well, the first question here is 'what ways are there of initiating a
> connection with another machine in VBA?'. Can you open sockets? Can you
> make HTTP requests? XMLRPC requests? Until we know this we can't help
> with the perl side.
> 
> If you can make HTTP requests, then this is probably the easiest answer.
> Set up a web server on the linux box, with your perl script as a CGI,
> and have the VBA perform a POST request which sends the pertinant(sp?)
> data from the spreadsheet and receives the data from the database back.
> 
> If you can't make any sort of connection from within Excel, then I
> reckon the best way forward is to install Perl on the windows machine as
> well, and have the VBA invoke a perl script. This script can then get at
> the open workbook using Win32::OLE, and communicate with the other
> machine in any way reasonable: say, you have inetd listen on a given
> port and invoke your perl script on the linux box, and the script on the
> windows machine can then open a socket and pass the data back and forth
> as needed.
> 
> You will need to design a protocol for these transactions; make sure you
> think hard about it, so that it's properly extensible when you need it
> to be. You will also need to think about security: how is the windows
> machine going to prove to the linux machine that it is who it claims it
> is, and vice versa (just as important in a case like this)? Is the data
> concerned sensitive, so that you need to use SSL or whatever to encrypt
> the transaction?
> 
> Modules to look at:
> Win32::OLE for talking to Excel
> IO::Socket::INET for opening sockets
> IO::Socket::SSL for opening encrypted SSL sockets
> DBI and DBD::mysql for talking to MySQL
> maybe Storable, for 'freezing' perl data structures so they can be sent
> to another perl process on a different machine
> CGI or CGI::Lite for writing CGI scripts
> 
> Ben


Hi,

Thanks for the detailed response and shedding some light on problem.
I am interested in the first suggestion regarding if I am able to make
a connection from within Excel.  In th section of questions listed
below.
How would I go about finding if I have this capability listed below?

Also, I would like to know where I could look up some sample code or
find
resources on the topics listed below.

thanks very much

> Well, the first question here is 'what ways are there of initiating a
> connection with another machine in VBA?'. Can you open sockets? Can you
> make HTTP requests? XMLRPC requests? Until we know this we can't help
> with the perl side.


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

Date: Wed, 2 Jun 2004 16:32:51 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Initiate perl script in linux from a Windows VBA program
Message-Id: <c9kvfj$o6u$1@wisteria.csv.warwick.ac.uk>


Quoth bearwreath@yahoo.ca (b wreath):
> Ben Morrow <usenet@morrow.me.uk> wrote in message news:<c8apvd$238$1@wisteria.csv.warwick.ac.uk>...
> > Quoth bearwreath@yahoo.ca (b wreath):
> > > I would appreciate help with the following.  I would like to be able
> > > to initiate a perl script that is residing on a linux server from an
> > > Excel workbook.  I am working on the Excel workbook in Windows. I
> > > would appreciate any pointers, sample code for accomplishing this in
> > > VBA or some other method.
> >
> > Well, the first question here is 'what ways are there of initiating a
> > connection with another machine in VBA?'. Can you open sockets? Can you
> > make HTTP requests? XMLRPC requests? Until we know this we can't help
> > with the perl side.
>
> How would I go about finding if I have this capability listed [above]?

Read the VBA documentation; ask in a VBA or Excel ng.

Ben

-- 
   If you put all the prophets,   |   You'd have so much more reason
   Mystics and saints             |   Than ever was born
   In one room together,          |   Out of all of the conflicts of time.
ben@morrow.me.uk                                    The Levellers, 'Believers'


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

Date: Wed, 2 Jun 2004 11:09:34 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Invisible Array Loop Counter?
Message-Id: <slrncbrutu.4gm.tadmc@magna.augustmail.com>

zzapper <david@tvis.co.uk> wrote:

> I'm still curious about this "grep {..} @t" syntax.


Then read the documentation for that function:

   perldoc -f grep


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


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

Date: 02 Jun 2004 14:08:05 GMT
From: Roger <roger1023@yahoo.com>
Subject: Range operator and odd numbers
Message-Id: <200462-1685-846502@foorum.com>


Greetings...

I have an array that is populated with odd numbers.

@odd_num =  ("1","3","5","7","9","11","13","15","17","19","21",
"23","25","27","29","31","33","35","37","39","41","43");

I would like to clean up this code and use the range operator '..' and I was 
seeking a clever way to get a set of odd numbers like above. AFAIK the range 
operator returns whole numbers.

Thanks for any insight.

-- 
Use our news server 'news.foorum.com' from anywhere.
More details at: http://nnrpinfo.go.foorum.com/


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

Date: Wed, 02 Jun 2004 17:56:56 +0100
From: "Richard Gration" <richard@zync.co.uk>
Subject: Re: Range operator and odd numbers
Message-Id: <c9l0sh$bq1$1@news.freedom2surf.net>

In article <200462-1685-846502@foorum.com>, "Roger" <roger1023@yahoo.com>
wrote:

> Greetings...
> I have an array that is populated with odd numbers.  @odd_num = 
> ("1","3","5","7","9","11","13","15","17","19","21",
> "23","25","27","29","31","33","35","37","39","41","43");  I would like
> to clean up this code and use the range operator '..' and I was seeking
> a clever way to get a set of odd numbers like above. AFAIK the range
> operator returns whole numbers.
> Thanks for any insight.
> 

here's a couple

@odd_num = map {2 * $_ + 1} (0 .. 21)

@odd_num = grep {$_ % 2} (1..43)

HTH :-)

Rich


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

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


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