[28163] in Perl-Users-Digest
Perl-Users Digest, Issue: 9527 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 26 18:05:45 2006
Date: Wed, 26 Jul 2006 15:05:09 -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, 26 Jul 2006 Volume: 10 Number: 9527
Today's topics:
Re: Blather-Adjusting Programs <freedomaintfree@verizon.net>
Re: Comparing values of multiple hash keys <tadmc@augustmail.com>
Re: Comparing values of multiple hash keys <tzz@lifelogs.com>
Re: Count values in multi dimensional array <1usa@llenroc.ude.invalid>
DNS with bind9 sucks, what is an easier tool for full D <bootiack@yahoo.com>
Re: DNS with bind9 sucks, what is an easier tool for fu <sqrex@poczta.fm>
Re: is perl a mess as it scales, and is it really hard <tadmc@augustmail.com>
Re: Profanity checking, phonetically. bpontarelli@gmail.com
Re: RExp matchs many times,how can i get the matched co <tadmc@augustmail.com>
Script to find unique words in a document <msgrinnell@charter.net>
Re: Script to find unique words in a document <mritty@gmail.com>
Re: Script to find unique words in a document <msgrinnell@charter.net>
Re: Script to find unique words in a document <rvtol+news@isolution.nl>
Re: Script to find unique words in a document axel@white-eagle.invalid.uk
Using an input/csv file to rename files <tdcarr@gmail.com>
Re: Using an input/csv file to rename files <1usa@llenroc.ude.invalid>
Re: using session managment in perl <tadmc@augustmail.com>
Re: What is the right syntax? <mrmnews@the-meissners.org>
Re: What is the right syntax? <jurgenex@hotmail.com>
Re: What is the right syntax? <abigail@abigail.nl>
Re: What is the right syntax? <chris-newman@bigpond.com>
Re: What is the right syntax? <tadmc@augustmail.com>
Win32::Printer -> override the window printer window diavolo-verde@libero.it
Re: Win32::Printer -> override the window printer windo <mritty@gmail.com>
Re: Win32::Printer -> override the window printer windo diavolo-verde@libero.it
Re: Win32::Printer -> override the window printer windo <mritty@gmail.com>
Re: Win32::Printer -> override the window printer windo diavolo-verde@libero.it
Re: Win32::Printer -> override the window printer windo diavolo-verde@libero.it
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 26 Jul 2006 17:33:13 GMT
From: harvelini <freedomaintfree@verizon.net>
Subject: Re: Blather-Adjusting Programs
Message-Id: <tHNxg.180834$F_3.90389@newssvr29.news.prodigy.net>
vjp2.at@at.BioStrategist.dot.dot.com wrote:
> You folks mean to tell me there's no program out there that would
> take a file of simple text and blatherise it to the level of another
> "reference" file? Or Adjust the "Fog Index" of a text file up or down
> from its input level. I'm totally serious. I'm tired of fighting.
> I just want to "get along".
>
> I have one idea: you score each verb and noun on, say, five,
> different scales, then you pile on similarly ranked adverbs and
> adjectives until you meet the volume requirement. Or you remove
> accordingly. In MS-Word type environments, you score less necessary
> modifiers, say , with orange-collored undersquiggles, the less
> necessary, the more undersquiggles.
>
> Message-ID: <dn55rq$mov$1@reader2.panix.com>
>
> I'm sure I've seen programs that generate blather but now I
> can't find one. I'm stuck in a wierd situation that comes up often
> enough: Some third-worlders insist you write pretentious casuistry
> when a few simple words are enough. It is sad in these day of "Fog
> Index" that we have people who are commitedly ideological and even
> theologically dogmatic about making prose incomprehensibly obfuscated
> and complicated. I want it in perl so it can be extremely portable.
>
> However, I want something I can control. For example, when it sees
> the word "customer" or "strategy" it should randomly chose one of
> three flowing phrases. I can write a simple one-to-one in sed, but I
> really hope some ingenious soul has already compiled a blatherisation
> table that I only need to tweak. The issue is the text should require
> no more than, say, ten percent editing to make it seem like it came
> from a genuinely glib casuistrous bullshit artist.
>
> I wouldn't mind if the program is ingenious enough to go both ways,
> or even to be adjustable (ie, "please set the fog index"). I am
> confronted with enough blathermaniacs and antiblathermaniacs to make
> my life way too complicated. By the time I get used to one lunatic, I
> have to instead conform to the other.
>
> Message-ID: <do5j5i$2da$3@reader1.panix.com>
>
> I think you could broadly generalise the most common writing styles are:
>
> 1. Cryptic misappropriated connotation (demanded by "scholars")
> 2. Telegraphic commercial (Taught by "Communications" programs)
> 3. Latinate bureaucratic (demanded by 3rd world bureaucrats)
> 4. Literary Synonymania (demanded by "English" professors/teachers)
>
> And these variances seem to be used to discriminate and segregate
> dogmatically and unfairly. "Can't we just all get along?"
>
> Message-ID: <dnvsup$p3u$1@reader1.panix.com>
>
> I went hunting on google for "chatterbot perl knowledge base". I
> "knew" Hugh Kenner back on BiX ca 1988. Foggy is a riot, but not what
> I needed, though I think sometime it may prove valuable when
> frustration with fools triggers my evil streak. I need foggy with a
> twist - a knowledge base I can tweak like foggy, but it should take a
> simple paragraph and turn it into a long blatherous paper that I can
> then spend a few minutes editing and it will say pretty much the same
> thing as my simple paragraph. For example I write "The customer is a
> petunia" and it writes "Our customers are very important to us. One of
> our multifarous customers has proven to be a petunia. Wheretofore and
> heretofore, this important,vaulabel and significant datum will be
> assessed strategically and applied to our models wherefrom we shall
> therefore optimise our tactics, strategy and operations so that we
> fully capture the economic benefits derivable from this customer."
> One form would work with a knowledge base where it is triggered by
> words like customer and petunia into random but reasonably meaningful
> ramblings. The other would be even better if it took a file with
> writing similar to the target and transformed the source using the
> target as a model (for style and size). I would really wish this was
> in perl so I could use it on the fly anywhere!
>
>
> nyc.transit Tue, 20 Dec 2005 23:19:28 +0000 (UTC)
>
> You remind me of how my folks got mistreated. They spoke with a
> heavy accent but at the university level. A lot of academics would
> love to converse endlessly with their precise and inquiring minds.
> Some "customer service" types would just hang up the phone when they
> heard the accent. One of my English teachers couldn't get over it how
> my folks had the nerve to correct her spelling.
>
> I was born here and once I had a boss say that the reason I
> disgreed on policy issues was I needed to improve my writing since I
> was Greeks and sent me to a writing class (she was Cuban and spoke
> with an accent, but I don't have an accent). Once someone asked me
> "You speak English so well, when did you come here" I looked at my
> watch and said "Oh, about 120 yrs ago." (Technically true, though my
> stowaway ancestors got sent back a month later) I once went to speak
> to a dean about something and he mentioned the essence of the
> conversation to a reporter and I saw in print that he described me as
> a foreign student (he, too, had an accent and was foreign born). When
> a previous president of my alma mater was introduced to alums, he saw
> my name badge and said "Ohhhh, Greek" shaking his head knowingly as I
> was seriously thinking of swatting him on the head like a fly.
>
>
>
>
> - = -
> Vasos-Peter John Panagiotopoulos II, Columbia'81+, Bio$trategist
> BachMozart ReaganQuayle EvrytanoKastorian
> http://ourworld.compuserve.com/homepages/vjp2/vasos.htm
> ---{Nothing herein constitutes advice. Everything fully disclaimed.}---
> [Urb sprawl confounds terror] [Remorse begets zeal] [Windows is for Bimbos]
> [Homeland Security means private firearms not lazy obstructive guards]
>
------------------------------
Date: Wed, 26 Jul 2006 14:39:57 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Comparing values of multiple hash keys
Message-Id: <slrnecfh8d.1fr.tadmc@magna.augustmail.com>
Jason <jwcarlton@gmail.com> wrote:
> Originally, the script was simple. Take a keyword entered by a form,
> compare it to each value of an array (@data), and return any value
> containing the entry:
>
> $var = param('keyword');
> foreach $key (@data) {
> if ($key =~ /$var/i) { push (@founddata, $key); }
> }
>
>
> But now I'm trying to allow for multi-word phrases, which is a bit more
> complex. I couldn't find how others are doing it,
Do just what you are already doing (but a hash is more natural for
representing a set), but do it once for each term in the multi-word phrase.
You then have N sets for your N-term phrase.
Find the intersection of the N sets, and you have the answer.
perldoc -q intersection
How do I compute the difference of two arrays? How do I compute the
intersection of two arrays?
> $var =~ s/(?:,|'|\.)//g; # Remove comma, apostrophe, or period
$var =~ tr/,'.//d; # Remove comma, apostrophe, or period
# only clearer and faster
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 26 Jul 2006 16:49:26 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Comparing values of multiple hash keys
Message-Id: <g69d5bshz1l.fsf@CN1374059D0130.kendall.corp.akamai.com>
On 26 Jul 2006, tadmc@augustmail.com wrote:
Jason <jwcarlton@gmail.com> wrote:
>
>> Originally, the script was simple. Take a keyword entered by a form,
>> compare it to each value of an array (@data), and return any value
>> containing the entry:
>>
>> $var = param('keyword');
>> foreach $key (@data) {
>> if ($key =~ /$var/i) { push (@founddata, $key); }
>> }
>>
>>
>> But now I'm trying to allow for multi-word phrases, which is a bit more
>> complex. I couldn't find how others are doing it,
>
>
> Do just what you are already doing (but a hash is more natural for
> representing a set), but do it once for each term in the multi-word phrase.
>
> You then have N sets for your N-term phrase.
>
> Find the intersection of the N sets, and you have the answer.
>
> perldoc -q intersection
>
> How do I compute the difference of two arrays? How do I compute the
> intersection of two arrays?
The OP may want the union of the sets, based on his imprecise
specifications :)
Ted
------------------------------
Date: Wed, 26 Jul 2006 15:08:57 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Count values in multi dimensional array
Message-Id: <Xns980C71827E4E7asu1cornelledu@127.0.0.1>
"Oliver Meister" <oli.meister@gmail.com> wrote in
news:1153924048.276616.172700@i42g2000cwa.googlegroups.com:
> Certainly my view is limited on HASH and PERL but couldn't find
> something working on google as suggested by A. Sinan Unur in the
> previous post.
Now you are really making stuff up! If you are referring to my reply to
your post:
http://groups.google.com/group/comp.lang.perl.misc/msg/d19742b6f1e28604
could you please tell me where on God's green earth I mention searching
Google?
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: 26 Jul 2006 12:28:55 -0700
From: "gavino" <bootiack@yahoo.com>
Subject: DNS with bind9 sucks, what is an easier tool for full DNS?
Message-Id: <1153942135.134339.21500@75g2000cwc.googlegroups.com>
anyone?
------------------------------
Date: 26 Jul 2006 14:55:56 -0700
From: "Sqrex" <sqrex@poczta.fm>
Subject: Re: DNS with bind9 sucks, what is an easier tool for full DNS?
Message-Id: <1153950956.253186.313430@i3g2000cwc.googlegroups.com>
In my opinion djbdns i very good replacment. It has modular
construction so i.e. u don`t need to run full dns to have only caching
function and it`s more secure.
gavino napisal(a):
> anyone?
------------------------------
Date: Wed, 26 Jul 2006 12:33:39 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: is perl a mess as it scales, and is it really hard to debug?
Message-Id: <slrnecf9rj.66j.tadmc@magna.augustmail.com>
gavino <bootiack@yahoo.com> wrote:
> I hear people bitch about perl but others say its most productive
> language.
Some of these people are correct, some of those people are wrong,
but most people bitch while using Perl productively!
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Jul 2006 09:02:56 -0700
From: bpontarelli@gmail.com
Subject: Re: Profanity checking, phonetically.
Message-Id: <1153929776.401103.50180@s13g2000cwa.googlegroups.com>
You could try this, but you have to buy it. I don't know of anything
else out there that has a clean enough list for most applications. Some
have hundreds of thousands of words, most of which are not really
profanity and others have only a few dozen words (like WikiPedia). This
has around 500 english words, 1000 misspellings, ratings, types, and
regular expressions. The link is:
http://badwords.inversoft.com
The regular expressions will help you out quite a bit I think.
Cheers,
-bp
shrike@cyberspace.org wrote:
> Howdy,
>
> I have a randomly generated alphabetic string, and I need to profanity
> check it, phonetically. I didn't see anything like this on CPAN.
>
> Anybody done anything like this?
>
> -Thanks in advance
> -Matt
------------------------------
Date: Wed, 26 Jul 2006 14:31:47 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: RExp matchs many times,how can i get the matched content?
Message-Id: <slrnecfgp3.1fr.tadmc@magna.augustmail.com>
Aukjan van Belkum <aukjan@gmail.com> wrote:
> Ben Morrow wrote:
>
>>
>> It's not an array, it's a list.
>>
> ok: s/array/list/gs
^
^
A useless use of a regex modifier.
s/array/list/g
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Jul 2006 12:29:56 -0700
From: "Mike" <msgrinnell@charter.net>
Subject: Script to find unique words in a document
Message-Id: <1153942196.143387.194130@m79g2000cwm.googlegroups.com>
I have a need to establish a lexicon for a surgical environment. I
have approximately 20,000,000 lines of text from which I need to
determine unique "words". For the time-being, a "word" is
space-delimited (excluding punctuation, etc). I have done some
searching, but don't see anything obvious as far as pre-existing
scripts for doing this, but figure such a beast must have been created
before. Would anyone have any suggestions? I can create a single file
and read from that file.
Thanks much,
Mike
------------------------------
Date: 26 Jul 2006 12:54:29 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Script to find unique words in a document
Message-Id: <1153943669.852614.263190@p79g2000cwp.googlegroups.com>
Mike wrote:
> I have a need to establish a lexicon for a surgical environment. I
> have approximately 20,000,000 lines of text from which I need to
> determine unique "words". For the time-being, a "word" is
> space-delimited (excluding punctuation, etc). I have done some
> searching, but don't see anything obvious as far as pre-existing
> scripts for doing this, but figure such a beast must have been created
> before.
If it has, this is not the place to look for it. This newsgroup deals
with helping people write and debug their own scripts, not to find
preexisting scripts.
> Would anyone have any suggestions? I can create a single file
> and read from that file.
Check the Perl FAQ:
$ perldoc -q word-frequency
Found in /opt2/Perl5_8_4/lib/perl5/5.8.4/pod/perlfaq6.pod
How can I print out a word-frequency or line-frequency
summary?
Modify that example to instead print out only those words found to have
a frequency of one.
Paul Lalli
------------------------------
Date: 26 Jul 2006 13:00:20 -0700
From: "Mike" <msgrinnell@charter.net>
Subject: Re: Script to find unique words in a document
Message-Id: <1153944019.901908.68890@i42g2000cwa.googlegroups.com>
Thanks much,
Mike
------------------------------
Date: Wed, 26 Jul 2006 21:49:51 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Script to find unique words in a document
Message-Id: <ea8o33.uc.1@news.isolution.nl>
Mike schreef:
> I have a need to establish a lexicon for a surgical environment. I
> have approximately 20,000,000 lines of text from which I need to
> determine unique "words". For the time-being, a "word" is
> space-delimited (excluding punctuation, etc). I have done some
> searching, but don't see anything obvious as far as pre-existing
> scripts for doing this, but figure such a beast must have been created
> before. Would anyone have any suggestions? I can create a single file
> and read from that file.
No Perl required.
If you put each word on its own line, for instance by using 'tr' to
replace each space and other word separating character by a \n, then the
file becomes usable for 'sort -u' or 'sort | uniq'.
There might be special characters that you want to keep, such as quote
or hyphen.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Wed, 26 Jul 2006 20:01:49 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: Script to find unique words in a document
Message-Id: <NSPxg.7238$5K2.710@fed1read03>
Mike <msgrinnell@charter.net> wrote:
> I have a need to establish a lexicon for a surgical environment. I
> have approximately 20,000,000 lines of text from which I need to
> determine unique "words". For the time-being, a "word" is
> space-delimited (excluding punctuation, etc). I have done some
> searching, but don't see anything obvious as far as pre-existing
> scripts for doing this, but figure such a beast must have been created
> before.
From your specification it is such a trivial task (about 17 lines of
code... including blank lines for readability for the total program) that nobody would
bother to save something like that as a specific script unless they
required repeated use of it.
> Would anyone have any suggestions? I can create a single file
> and read from that file.
Read in the files line by line, split into words, save individual words
in a hash.
Axel
------------------------------
Date: 26 Jul 2006 13:51:39 -0700
From: "Terry" <tdcarr@gmail.com>
Subject: Using an input/csv file to rename files
Message-Id: <1153947099.105094.22110@i42g2000cwa.googlegroups.com>
I am a few hours into my life after Perl.
I need to rename approximately 5000 .jpg files, which I think I have
figured out thanks to "Learning Perl" 3rd. Ed. (pg. 176).
Unlike that example, I would like to compare/match the file names to a
table/field in a csv file and once matched rename the file to the
second table/field in the csv file so that ABCDEFG.jpg becomes
1111111.jpg and ABCDEFH.jpg becomes 1111112.jpg and so on.
I've been searching my perldoc, comp.lang.perl.misc and "Learning Perl"
most of the day and haven't found anything that looks like what I want
to do, but I'm chalking that up to not knowing where to look.
Any suggestions of howto: or where to look would be greatly
appreciated.
Thank you
Terry
------------------------------
Date: Wed, 26 Jul 2006 21:01:48 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Using an input/csv file to rename files
Message-Id: <Xns980CAD554F98Fasu1cornelledu@127.0.0.1>
"Terry" <tdcarr@gmail.com> wrote in news:1153947099.105094.22110
@i42g2000cwa.googlegroups.com:
> Unlike that example, I would like to compare/match the file names to a
> table/field in a csv file and once matched rename the file to the
> second table/field in the csv file so that ABCDEFG.jpg becomes
> 1111111.jpg and ABCDEFH.jpg becomes 1111112.jpg and so on.
...
> Any suggestions of howto: or where to look would be greatly
> appreciated.
You can use Text::CSV_XS or the DBI interface to parse the CSV files. I
would opt for the latter:
http://search.cpan.org/~jzucker/DBD-CSV-0.22/lib/DBD/CSV.pm
You can then modify the following short script to look up the new name
from the table rather than using Exif information:
http://www.unur.com/comp/ppp/exren.html
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Wed, 26 Jul 2006 14:44:01 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: using session managment in perl
Message-Id: <slrnecfhg1.1fr.tadmc@magna.augustmail.com>
madan <madan.narra@gmail.com> wrote:
> guyz please...
>
> i was just asking for help from u but not to argue
Please choose one posting address and stick with it.
It is difficult to killfile your moving target.
Thank you.
> if at all u know the logic please do post ...but dont just say its
> totally junk for this group..
It's totally junk for this group.
(I don't take direction very well.)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Jul 2006 11:40:57 -0400
From: Michael Meissner <mrmnews@the-meissners.org>
Subject: Re: What is the right syntax?
Message-Id: <m3ejw85q7q.fsf@tiktok.the-meissners.org>
Chris Newman <chris-newman@bigpond.com> writes:
> @names = {"a","b","c"};
>
> @occup = {"d","e","f'};
>
> foreach $i @names {
>
> print ("$names[i], $occup[i] \n");
>
> }
>
> The result I am after follows
>
> a,d
> be
> cf
>
> I suspect that $i returns the value stored in each element in the array not
> the index . How do I change the code to make this happen?
You don't want $i to be the elements in @names, but an index:
@names = {"a", "b", "c"};
@occup = {"d", "e", "f"};
for ($i = 0; $i <= $#names; $i++) {
print $names[$i], $occup[$i], "\n";
}
However you might want to restructure the app to use more complicated data
structures, rather than parallel arrays:
@db = ( { "names" => "a", "occup" => "d" },
{ "names" => "b", "occup" => "e" },
{ "names" => "c", "occup" => "f" } );
foreach $i (0..$#db) {
print $db[$i]->{"names"}, $db[$i]->{"occup"}, "\n";
}
or:
@db = ( { "names" => "a", "occup" => "d" },
{ "names" => "b", "occup" => "e" },
{ "names" => "c", "occup" => "f" } );
foreach $i (@db) {
print $i->{"names"}, $i->{"occup"}, "\n";
}
--
Michael Meissner
email: mrmnews@the-meissners.org
http://www.the-meissners.org
------------------------------
Date: Wed, 26 Jul 2006 16:04:19 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: What is the right syntax?
Message-Id: <7oMxg.11889$Oz3.6538@trnddc02>
Michael Meissner wrote:
> You don't want $i to be the elements in @names, but an index:
>
> @names = {"a", "b", "c"};
> @occup = {"d", "e", "f"};
> for ($i = 0; $i <= $#names; $i++) {
Why not
for $i (0..$#names) {
> print $names[$i], $occup[$i], "\n";
> }
jue
------------------------------
Date: 26 Jul 2006 19:24:12 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: What is the right syntax?
Message-Id: <slrnecfgas.3d2.abigail@alexandra.abigail.nl>
Chris Newman (chris-newman@bigpond.com) wrote on MMMMDCCXII September
MCMXCIII in <URL:news:0001HW.C0ED659E001C4042F0284500@news.bigpond.com>:
;;
;; @names = {"a","b","c"};
;;
;; @occup = {"d","e","f'};
;;
;; foreach $i @names {
;;
;; print ("$names[i], $occup[i] \n");
;;
;; }
;;
;; The result I am after follows
;;
;; a,d
;; be
;; cf
;;
;; I suspect that $i returns the value stored in each element in the array not
;; the index . How do I change the code to make this happen?
my @names = qw [a b c];
my @occup = qw [d e f];
for (my $i = 0; $i < @names; $i ++) {
printf "%s %s\n", $names [$i], $occup [$i];
}
Abigail
--
perl -wle 'sub _ "Just another Perl Hacker"; print prototype q ^_^'
------------------------------
Date: Wed, 26 Jul 2006 20:41:08 GMT
From: Chris Newman <chris-newman@bigpond.com>
Subject: Re: What is the right syntax?
Message-Id: <0001HW.C0EE0EDC0020E07AF0407500@news.bigpond.com>
On Thu, 27 Jul 2006 05:24:12 +1000, Abigail wrote
(in article <slrnecfgas.3d2.abigail@alexandra.abigail.nl>):
> Chris Newman (chris-newman@bigpond.com) wrote on MMMMDCCXII September
> MCMXCIII in <URL:news:0001HW.C0ED659E001C4042F0284500@news.bigpond.com>:
> ;;
> ;; @names = {"a","b","c"};
> ;;
> ;; @occup = {"d","e","f'};
> ;;
> ;; foreach $i @names {
> ;;
> ;; print ("$names[i], $occup[i] \n");
> ;;
> ;; }
> ;;
> ;; The result I am after follows
> ;;
> ;; a,d
> ;; be
> ;; cf
> ;;
> ;; I suspect that $i returns the value stored in each element in the array
> not
> ;; the index . How do I change the code to make this happen?
>
>
> my @names = qw [a b c];
> my @occup = qw [d e f];
>
> for (my $i = 0; $i < @names; $i ++) {
> printf "%s %s\n", $names [$i], $occup [$i];
> }
>
>
> Abigail
>
thanks again people must appreciated :)
------------------------------
Date: Wed, 26 Jul 2006 15:57:19 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: What is the right syntax?
Message-Id: <slrnecflpf.1u6.tadmc@magna.augustmail.com>
Chris Newman <chris-newman@bigpond.com> wrote:
> foreach $i @names {
^^^^^^
^^^^^^ no parenthesis
> print ("$names[i], $occup[i] \n");
^ ^
^ ^ no dollar signs
That is not Perl code.
> How do I change the code to make this happen?
This is the Perl newsgroup.
If you want to discuss it _here_, then the first change should be
to make it into Perl code.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Jul 2006 09:24:19 -0700
From: diavolo-verde@libero.it
Subject: Win32::Printer -> override the window printer window
Message-Id: <1153931059.076545.177640@i42g2000cwa.googlegroups.com>
Hello,
I my application I would like to send the data to the default printer,
without any user action, is it possible using Wind32::Printer module?
Dave
------------------------------
Date: 26 Jul 2006 12:11:00 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Win32::Printer -> override the window printer window
Message-Id: <1153941060.392779.95490@m79g2000cwm.googlegroups.com>
diavolo-verde@libero.it wrote:
> I my application I would like to send the data to the default printer,
> without any user action, is it possible using Wind32::Printer module?
What did you find when you read the documentation for Win32::Printer,
searching specifically for words like "default printer"?
Paul Lalli
------------------------------
Date: 26 Jul 2006 13:06:25 -0700
From: diavolo-verde@libero.it
Subject: Re: Win32::Printer -> override the window printer window
Message-Id: <1153944385.163603.228360@75g2000cwc.googlegroups.com>
Paul Lalli ha scritto:
> diavolo-verde@libero.it wrote:
>
> > I my application I would like to send the data to the default printer,
> > without any user action, is it possible using Wind32::Printer module?
>
> What did you find when you read the documentation for Win32::Printer,
> searching specifically for words like "default printer"?
Hi Paul, I realized that my question was not clear. What I want is to
send data directly without user intervention. I can choose which
printer to print programmatically but then window raise the Print
Dialog asking the user to press OK. I don't want this happens.
Thanks,
David
------------------------------
Date: 26 Jul 2006 13:35:28 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Win32::Printer -> override the window printer window
Message-Id: <1153946128.258017.168410@p79g2000cwp.googlegroups.com>
diavolo-verde@libero.it wrote:
> Paul Lalli ha scritto:
>
> > diavolo-verde@libero.it wrote:
> >
> > > I my application I would like to send the data to the default printer,
> > > without any user action, is it possible using Wind32::Printer module?
> >
> > What did you find when you read the documentation for Win32::Printer,
> > searching specifically for words like "default printer"?
>
> Hi Paul, I realized that my question was not clear. What I want is to
> send data directly without user intervention. I can choose which
> printer to print programmatically but then window raise the Print
> Dialog asking the user to press OK. I don't want this happens.
I understood exactly what you said. What part of my post led you to
believe otherwise? Why did you completely ignore my question?
Paul Lalli
------------------------------
Date: 26 Jul 2006 13:46:32 -0700
From: diavolo-verde@libero.it
Subject: Re: Win32::Printer -> override the window printer window
Message-Id: <1153946792.407855.228140@p79g2000cwp.googlegroups.com>
Paul Lalli ha scritto:
> I understood exactly what you said. What part of my post led you to
> believe otherwise? Why did you completely ignore my question?
>
I'm sorry Paul, the english is not my native language so probably I'm a
little bit aggressive; if this is the case, please excuse me.
Frankly speaking I cannot understand what you are trying to tell me. I
read the documentation and I didn't find the method to disable the
confirmation window to appear.
This is my Printer instantiation
my $dc = new Win32::Printer(
papersize => A4,
#dialog => NOSELECTION,
description => 'schedine',
unit => 'mm'
);
I tryed enabling dialog and others. What do I miss?
This is an excerpt from documentation:
If both "printer" and dialog attributes omitted- systems default
printer is used.
Printer dialog settings. You may use the combination of the following
flags ($dc->{flags} contains modified printer dialog flags):
ALLPAGES = 0x000000
The default flag that indicates that the All radio button is initially
selected. This flag is used as a placeholder to indicate that the
PAGENUMS and SELECTION flags are not specified.
SELECTION = 0x000001
If this flag is set, the Selection radio button is selected. If neither
PAGENUMS nor SELECTION is set, the All radio button is selected.
PAGENUMS = 0x000002
If this flag is set, the Pages radio button is selected. If this flag
is set when the new method returns, the $dc->{maxp} and $dc->{minp}
variables indicate the starting and ending pages specified by the user.
NOSELECTION = 0x000004
Disables the Selection radio button.
NOPAGENUMS = 0x000008
Disables the Pages radio button and the associated edit controls.
PRINTTOFILE = 0x000020
If this flag is set, the Print to File check box is selected.
PRINTSETUP = 0x000040
Causes the system to display the Print Setup dialog box rather than the
Print dialog box.
NOWARNING = 0x000080
Prevents the warning message from being displayed when there is no
default printer.
DISABLEPRINTTOFILE = 0x080000
Disables the Print to File check box.
HIDEPRINTTOFILE = 0x100000
Hides the Print to File check box.
NONETWORKBUTTON = 0x200000
Hides and disables the Network button.
------------------------------
Date: 26 Jul 2006 13:54:50 -0700
From: diavolo-verde@libero.it
Subject: Re: Win32::Printer -> override the window printer window
Message-Id: <1153947290.476985.38100@i42g2000cwa.googlegroups.com>
diavolo-verde@libero.it ha scritto:
>> I tryed enabling dialog and others. What do I miss?
I am a stupid.
I'm testing my program and I set the default printer as " adobe PDF",
it was the PDF driver to raise the window, not Windows.
I'm sorry.
Dave
------------------------------
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 9527
***************************************