[23620] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5827 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 19 09:05:59 2003

Date: Wed, 19 Nov 2003 06:05:14 -0800 (PST)
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, 19 Nov 2003     Volume: 10 Number: 5827

Today's topics:
    Re: [OT] Re: Creating UNICODE filenames with PERL 5.8 <ben.liddicott@comodogroup.com>
    Re: bit sequence match <eddhig22@yahoo.com>
    Re: Creating UNICODE filenames with PERL 5.8 (Anno Siegel)
    Re: Creating UNICODE filenames with PERL 5.8 <flavell@ph.gla.ac.uk>
    Re: Creating UNICODE filenames with PERL 5.8 <flavell@ph.gla.ac.uk>
    Re: Error trapping $RS_ADO->Open($SQL_ADO, $Conn_ADO, 1 <ben.liddicott@comodogroup.com>
    Re: Error trapping $RS_ADO->Open($SQL_ADO, $Conn_ADO, 1 <ben.liddicott@comodogroup.com>
        Excel question. <spikeywan@bigfoot.com.delete.this.bit>
    Re: extract block of text (Anno Siegel)
        How to access  com+ components in PERL (Natarajan)
    Re: How to access  com+ components in PERL <ben.liddicott@comodogroup.com>
    Re: Include &/or option in flatfile db query.. (Oeln)
    Re: Include &/or option in flatfile db query.. (Tad McClellan)
        Inserting the same thing multi times into array. <spikeywan@bigfoot.com.delete.this.bit>
    Re: Inserting the same thing multi times into array. <usenet@morrow.me.uk>
    Re: Inserting the same thing multi times into array. <noreply@gunnar.cc>
    Re: Inserting the same thing multi times into array. <feralboncer@netscape.net>
    Re: MIME::Lite - From email address to name of the comp <me@privacy.net>
    Re: MIME::Lite - From email address to name of the comp <provicon@earthlink.net>
    Re: MIME::Lite - From email address to name of the comp <usenet@morrow.me.uk>
        mod_perl win2k mail::sender problem <news@ducati.demon.co.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 19 Nov 2003 14:00:24 -0000
From: "Ben Liddicott" <ben.liddicott@comodogroup.com>
Subject: Re: [OT] Re: Creating UNICODE filenames with PERL 5.8
Message-Id: <bpft1q$kbk$1@kylie.comodogroup.com>

Some history required...


"Ben Morrow" <usenet@morrow.me.uk> wrote in message
news:bpel00$sl6$1@wisteria.csv.warwick.ac.uk...
> yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
> > Ben Morrow (usenet@morrow.me.uk) wrote:
> > : OK, your problem here is that Win2k is being stupid about Unicode: any
> > : sensible OS that understood UTF8 would be fine :).
> >
> > Hum, NT has been handling unicode for at least ten years (3.5, 1993) by
> > the simple expedient of using 16 bit characters.  It is hardware that is
> > stupid, by continuing to use ancient tiny 8 bit elementary units.
>
> OK, I invited that with gratuitous OS-bashing :)... nevertheless:
>
> 1. Unicode is *NOT* a 16-bit character set. UTF16 is an evil bodge to
>    work around those who started assuming it was before the standards
>    were properly in place.

Unicode 1.0 WAS a 16-bit character set. So there. UTF16 is a representation
of Unicode 3.0 which is selected to be backwards compatible with Unicode
1.0.

The reason why NT doesn't use UTF-8 is that --- wait for it --- it wasn't
invented back then. UTF-8 was specified in 1993, and adopted as an ISO
standard in 1994. Windows NT shipped in 1993, after 5 years in development.
Guess what: Decision on character set had to be made in the eighties.

Yes, they got it wrong. They should have selected UTF-8. They should have
INVENTED UTF-8.

So you can knock them for not having the foresignt to know that 65535
characters wouldn't be enough. That's a mistake a lot of people made, and
with hindsight it is unaccountable: It required a concious decision to
exclude uncommon characters. The best explanation I have heard for why this
is wrong: "An uncommon character is a common character if it is your name,
or the name of the place where you live".

But don't knock them for not using UTF-8. Clearly anyone designing an OS now
would use UTF-8, of course.

Cheers,
Ben Liddicott




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

Date: Wed, 19 Nov 2003 21:38:06 +1100
From: Edo <eddhig22@yahoo.com>
Subject: Re: bit sequence match
Message-Id: <3FBB480E.7050303@yahoo.com>


> : who can I have the results sored by keys in each hash?
> 
> If you want them sorted in the Data::Dumper output, set
> $Data::Dumper::Sortkeys to a true value.  Controlling that and other
> aspects of the output are described in the Data::Dumper documentation.
> 

what I wanted to do is sort the hash at the time or once it's been created.

ok.. let me have a go
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;  # invaluable for debugging data structures

my %h1 = (
           1 => '01',   2 => '00',   3 => '10', 4 => '11', 5 => '11'
	  );
my %h2 = (
	  20 => '00',  21 => '01',  22 => '00', 23 => '10', 24 => '11',
	  41 => '11',  42 => '10',  43 => '00',
	  111 => '01', 112 => '00', 119 => '10', 120 => '11', 121 => '11'
	  );
my @k1 = sort {$a <=> $b} keys %h1;
my @k2 = sort {$a <=> $b} keys %h2;
my $look_for = pack('(B2)*' => @h1{ @k1 });
my $look_in  = pack('(B2)*' => @h2{ @k2 });
my @results;
while( $look_in =~ /(?=\Q$look_for\E)/g ) {
	my %match = map { $_ => $h2{$_} } @k2[ $-[0] .. $-[0]+@k1-1 ];
	my %sorted_match = sort {$a <=> $b} keys %match;
	push @results, \%sorted_match;
}

print Dumper ( @results, "\n" );


Odd number of elements in hash assignment at prog/play line 21.
Odd number of elements in hash assignment at prog/play line 21.
$VAR1 = {
           '21' => '22',
           '23' => '24',
           '41' => undef
         };
$VAR2 = {
           '119' => '120',
           '111' => '112',
           '121' => undef
         };
$VAR3 = '
';

well. how could I do this sorting?

Also, I need to get the values of sorted %h1 in array
my @v1 = sort {$a <=> $b} keys %h1; no this is not right, I need the 
values and not the keys in @v1 but I need the values according to sorted 
keys of %h1.
and an equal number of values starting form 1st to number of items in 
@v1 from sorted %h2 in another array @v2
my @val2 = sort {$a <=> $b} keys %h2;
my @v2;
my $i = 0;
while ( $i =< $#v1 ) {
	push @v2,
this is just not right at all, I am giving up.
and once I have both array, I feed them in a sub which I have that will 
return a number.
if ( sim (@v1, @v2) > .5 ) {
	again create @AoH and print it like the original code in past post.  man 
I hope I am explaining this right.

}
just explaining it in english is hard, let alone doing it in perl. I 
which perl was my second language.


	



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

Date: 19 Nov 2003 11:53:24 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Creating UNICODE filenames with PERL 5.8
Message-Id: <bpfljk$p3v$4@mamenchi.zrz.TU-Berlin.DE>

Allan Yates <allan@yates.ca> wrote in comp.lang.perl.misc:
> But 
> 
> You are correct that unicode is not an acronym and should not be
> capitalised. My deepest apologies for offending you through the use of
> my grammer. I was not aware that grammer police were covering this
> newsgroup.

Grammar.  And grammar isn't the problem, spelling is.

>             PERL is an acronym, "Practical Extraction and Report
> Language", and thus may be capitalised.

Nope.  That was retro-fitted.

> Allan.
> 
> P.S. Please don't even think of chastising me for top posting versus
> bottom posting. Different people have different preferences.

Complaining about grammar police and playing thought police?

> P.P.S. For the people who have ignored my grammer and helped me in my
> quest, I am very appeciative.

Translation:  "Others can fuck off".  I think you got what you want.

Anno


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

Date: Wed, 19 Nov 2003 12:58:49 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Creating UNICODE filenames with PERL 5.8
Message-Id: <Pine.LNX.4.53.0311191243570.25320@ppepc56.ph.gla.ac.uk>

On Wed, 18 Nov 2003, Malcolm Dew-Jones wrote:

> Hum, NT has been handling unicode for at least ten years (3.5, 1993) by
> the simple expedient of using 16 bit characters.

 ...which unfortunately turns out to be somewhat of a mistake, seeing
that Unicode went and broke the 16-bit boundary.

> It is hardware that is
> stupid, by continuing to use ancient tiny 8 bit elementary units.

utf-8 is the closest they managed to get to variable-length character
encoding.  It's not perfect, but it gets around quite a lot of the
compatibility problems that exist with other approaches.

> Imagine if all that hardware still used 16 or 24 bit memory addresses.

Imagine if every us-ascii character were required to occupy 64 bits?
And then there's legacy data to think about.

> Character size was always a compromise between functionality and memory.

Agreed.

> Character size continually increased from the first character manipulating
> electronic equipment of the (gee, way way back 1930's or so, believe it or
> not)

Interestingly, those early codes regularly had shift-in and shift-out
codes to extend their repertoire.  A practice which faded out for a
while, almost got reborn in a big way in ISO-2022, and then -
iso-10646/Unicode and associated encodings.  I wonder what the future
holds in store?  ;-)

> Character size remains frozen due to one of murphy's laws regarding the
> success of hardware first build using compromises that were appropriate
> twenty years ago.

It's easy to poke fun, but it's harder to come up with a viable
compromise IMHO.

all the best


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

Date: Wed, 19 Nov 2003 13:05:35 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Creating UNICODE filenames with PERL 5.8
Message-Id: <Pine.LNX.4.53.0311191259140.25320@ppepc56.ph.gla.ac.uk>

On Wed, 19 Nov 2003, Anno Siegel reveals to all and sundry that:

> Allan Yates <allan@yates.ca> wrote in comp.lang.perl.misc:
>
> > P.P.S. For the people who have ignored my grammer and helped me in my
> > quest, I am very appeciative.

I don't think so.  O.P could show appreciation by trying to fit in
with the conventions of Usenet, and participate with the sharing.
Spitting in the group's collective face is no way to show one's
appreciation, that's for sure.

> Translation:  "Others can fuck off".

I took the hint, too.

> I think you got what you want.

I guess he did, just the once.  Well, I hope more-perceptive others
can learn from his mistakes, and I mean not only in terms of technical
content but also in terms of newsgroup interaction.

So much for pot luck.


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

Date: Wed, 19 Nov 2003 12:48:32 -0000
From: "Ben Liddicott" <ben.liddicott@comodogroup.com>
Subject: Re: Error trapping $RS_ADO->Open($SQL_ADO, $Conn_ADO, 1, 1)
Message-Id: <bpfor3$fph$1@kylie.comodogroup.com>

eval{
    $Conn_ADO->Open($DSN_ADO);  #<-- *** This one ***
}
if($@){
    # Failed to open.
}

Or even better:

use Error;

try{
    # do something that might die or croak.
    $Conn_ADO->Open($DSN_ADO);  #<-- *** This one ***

}otherwise{
    # died or croaked. Do something about it.

};# don't forget the semicolon

See "perldoc Error" for more.

Cheers,
Ben Liddicott

"Geek" <nospam@nospam.com> wrote in message
news:3fba4982$1@cpns1.saic.com...
> Is there any way to trap for errors in the "->Open" statements below?
>
> Thanks.
>
> $Conn_ADO = Win32::OLE->new("ADODB.Connection");
> $RS_ADO   = Win32::OLE->new("ADODB.Recordset");
>
> $DSN_ADO = "Provider=SQLOLEDB.1;Persist Security
> Info=False;Database=DB1;Data Source=duh;UID=whatever;PWD=noway;Connect
> Timeout=30";
>
> $Conn_ADO->Open($DSN_ADO);  #<-- *** This one ***
>
> $SQL_ADO = <<EOF;
>  SELECT *
>  FROM TaskOrder
>  ORDER BY TaskID
> EOF
>
> $RS_ADO->Open($SQL_ADO, $Conn_ADO, 1, 1)  #<-- *** And this one ***
>
>




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

Date: Wed, 19 Nov 2003 13:12:07 -0000
From: "Ben Liddicott" <ben.liddicott@comodogroup.com>
Subject: Re: Error trapping $RS_ADO->Open($SQL_ADO, $Conn_ADO, 1, 1)
Message-Id: <bpfq78$hjb$1@kylie.comodogroup.com>

My mistake: If you want your objects to croak on error, you have to say:

    Win32::OLE->Option(Warn=>3);

Otherwise you can check FAILED(Win32::OLE::LastError()), where:

    sub FAILED($){$_[0] & 0x80000000;}
    sub SUCCEEDED($){not ($_[0] & 0x80000000);}
    $Conn_ADO->Open($DSN_ADO);  #<-- *** This one ***
    SUCCEEDED(Win32::OLE::LastError()) or croak(Win32::OLE::LastError());


Values of LastError without the top bit set are success codes, which you
won't see often.

There are other options too. perldoc Win32::OLE for more.

Cheers,
Ben Liddicott


"Ben Liddicott" <ben.liddicott@comodogroup.com> wrote in message
news:bpfor3$fph$1@kylie.comodogroup.com...
> eval{
>     $Conn_ADO->Open($DSN_ADO);  #<-- *** This one ***
> }
> if($@){
>     # Failed to open.
> }
>
> Or even better:
>
> use Error;
>
> try{
>     # do something that might die or croak.
>     $Conn_ADO->Open($DSN_ADO);  #<-- *** This one ***
>
> }otherwise{
>     # died or croaked. Do something about it.
>
> };# don't forget the semicolon




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

Date: Wed, 19 Nov 2003 11:39:59 -0000
From: "Richard S Beckett" <spikeywan@bigfoot.com.delete.this.bit>
Subject: Excel question.
Message-Id: <bpfktd$iqs$1@newshost.mot.com>

Guys,

I want to be able to work out how to do things in excel by myself, but I
don't know how to convert between the macro syntax, and that required in
perl modules.

The 3 things I want to do currently are:
1. Make columns Autofit.
2. Merge cells.
3. Freeze panes.

To this end, I recorded a macro. It looks like this...

Sub Macro1()
    Columns("A:BX").Select
    Columns("A:BX").EntireColumn.AutoFit
    ActiveWindow.ScrollColumn = 1
    Range("F5:H5").Select
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .MergeCells = False
    End With
    Selection.Merge
    Range("B2").Select
    ActiveWindow.FreezePanes = True
End Sub

How do I get from this to the commands I need to use in either
Spreadsheet::WriteExcel, or Win32::OLE?

Thanks.
-- 
R.
GPLRank +79.699




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

Date: 19 Nov 2003 10:03:52 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: extract block of text
Message-Id: <bpff68$p3v$1@mamenchi.zrz.TU-Berlin.DE>

mike <s99999999s2003@yahoo.com> wrote in comp.lang.perl.misc:
> Dave Weaver <zen13097@zen.co.uk> wrote in message
> news:<slrnbrjq93.4l0.zen13097@wormhole.homelinux.org>...
> > On Mon, 17 Nov 2003 16:51:28 +0000 (UTC),
> > 		    Ben Morrow <usenet@morrow.me.uk> wrote:
> > >  
> > > <untested>
> > >  
> > >  perl -ne'next if /^\s*$/; print if m|/* -+ Heading2| .. m|/* -+ Heading3|'
> > >  
> > 
> > ITYM:
> > 
> >    perl -ne'next if /^\s*$/; print if m|/\* -+ Heading2| .. m|/\* -+
> Heading3|'
> > 
> > <also untested>
> > 
> > Dave.
> 
> Thanks everyone for the tips that you have given
> 
> I went back to try out this piece instead
> 
> while($line=<FILE>)
> {
>         chomp($line);
>         if ( $line =~ m/\/\* -+ $search*/ ) {
>         while ( $nextline = <FILE>)
>         {
>                 if ( $nextline =~ m|\/\* -+| )
>                 {
>                         last;
>                 }
>                 print "$nextline" ;
>         }
> }
> 
> i think it works ok (please correct me if i am wrong thanks :-)... but
> i read from perl docs that "last" exits the current
> so was wondering is it necessary to put a "last" just before ending
> the outer
> while...
> 
> 
> while($line=<FILE>)
> {
>         chomp($line);
>         if ( $line =~ m/\/\* -+ $search*/ ) {
>         while ( $nextline = <FILE>)
>         {
>                 if ( $nextline =~ m|\/\* -+| )
>                 {
>                         last;
>                 }
>                 print "$nextline" ;
>         }
> last;
> }

That would unconditionally end the outer loop after the first round,
certainly not what you want.

The way the program was given, it continues to search after each match.
If you only want the first match, label the outer loop (see perldoc -f
last):

    LOOP: while($line=<FILE>)
    {
            chomp($line);
            if ( $line =~ m/\/\* -+ $search*/ ) {
            while ( $nextline = <FILE>)
            {
                    if ( $nextline =~ m|\/\* -+| )
                    {
                            last LOOP;
                    }
                    print "$nextline" ;
            }
    }

Anno


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

Date: 19 Nov 2003 02:35:56 -0800
From: natu_k@hotmail.com (Natarajan)
Subject: How to access  com+ components in PERL
Message-Id: <53fbf637.0311190235.35549e93@posting.google.com>

I am pretty new to perl. i am having com+ components running in
component services coded in vb6.I want to know, how i can  instantiate
these components in Perl scripting.I should be able instantiate these
components  and call the object's methods in Perl.

Pls some body help me how to go about it.

regards
Natarajan


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

Date: Wed, 19 Nov 2003 12:50:23 -0000
From: "Ben Liddicott" <ben.liddicott@comodogroup.com>
Subject: Re: How to access  com+ components in PERL
Message-Id: <bpfouj$fu7$1@kylie.comodogroup.com>

use Win32::OLE;

You are going to have trouble programming the transactions, if that's what
you want to do. Everything else should be hunky-dory though.

Cheers,
Ben Liddicott


"Natarajan" <natu_k@hotmail.com> wrote in message
news:53fbf637.0311190235.35549e93@posting.google.com...
> I am pretty new to perl. i am having com+ components running in
> component services coded in vb6.I want to know, how i can  instantiate
> these components in Perl scripting.I should be able instantiate these
> components  and call the object's methods in Perl.
>
> Pls some body help me how to go about it.
>
> regards
> Natarajan




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

Date: 19 Nov 2003 03:45:48 -0800
From: ohmy9od@yahoo.com (Oeln)
Subject: Re: Include &/or option in flatfile db query..
Message-Id: <ffde43bc.0311190345.54326c18@posting.google.com>

"A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message news:<Xns9437DD2BD3BC6asu1cornelledu@132.236.56.8>...
> ohmy9od@yahoo.com (Oeln) wrote in news:ffde43bc.0311162254.298c4521
> @posting.google.com:
> 
> > I've got a flat text file db (tab delimited) & a form that lets one
> > query it online. In its current incarnation, it only lets one input a
> > term to look for in the file, & outputs the lines in the file which
> > include that term. If the input 'term' incldes ' ', it considers it
> > one term. I'd like to increase its functionality by including the &/or
> > option (&, of course, therefore identifying each term input to the
> > form individually).
> > 
> > The form that includes the query option: 
> > 
> > <form method="post" action="cgi-bin/odb.pl">
> >      <input type="text" name="input">
> >      <input type="hidden" name="oper" value="query">
> >      <input type="submit" value="Okay">
> >      <input type="reset" value="Clear">
> > </form>
> > 
> > In odb.pl I've got the following in order to parse the form itself: 
> > 
> > if ($ENV{'REQUEST_METHOD'} eq 'POST') {
> >      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> >      @pairs = split(/&/, $buffer);
> >      foreach $pair (@pairs)
> >      {
> >           ($name, $value) = split(/=/, $pair);
> >           $value =~ tr/+/ /;
> >           $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> >           $contents{$name} = $value;
> >      }
> > }
> 
> Hmmmm ... Gunnar, if you need any more proof that my objection this code 
> from the "arrange form data in same order as on form" thread was based on 
> the fact that it seems to be very prolifically copied and pasted by 
> clueless people, look no further.
> 

I'm inferring there's an issue with this code? It could be..it was in
the original code I was given & I've not changed it; but I'm not
certain if that's what you're implying or not. I'll own up to being
clueless - it's my intent to overcome the ignorance that incited my
inquiry.. ;)

> > I've then got, in order to do the query, the following: 
> > 
> > if ($contents{'oper'} eq "query") {
> >      open (FILE, "$odb") || do {&no_open;};
> >      &output_header;
> >      &output_open;
> 
> Do you know why you have an ampersand preceding the function calls?
> 

I figured it was only to indicate it was a function call. Otherwise,
no. I'd be interested though; I'll look for info on that.

> >      $count=0;
> >      @ordered = sort(<FILE>);
> 
> Is reading the whole file in really a good idea? And, if you are going to 
> read the whole file in and, still go through each item, why are you sorting 
> the lines?
> 

It's the only option I'm even a little bit familiar with I guess. It's
a flatfile - if it got too large it would no longer be a good idea
inherently; therefore, I guess it's not overly important to me if its
optimized or not (I'd only ever go with a flatfile in the first place
if I intended for it not to get too large).

It orders the output - I'd like to offer this as an option, too (i.e.,
"identify the field to order by"); but I've not gotten that far with
it yet..

> > 
> >      foreach $pair (@ordered) {
> >           if ($pair =~ /$contents{'input'}/gi) {   
> >                $count++;
> >                @item = split(/\t/, $pair);
> >                &output_item;
> >           }
> >      }  
> 
> This is the point I get impatient and frustruted and ignore the rest of 
> your post. Instead of writing in a prose style and expecting your readers 
> to figure out how multiple bits of code relate to each other, you should 
> try to include self contained code and data others can try out to see 
> what's happening as well as what expect the code to do etc etc. Please see 
> the posting guidelines posted here regularly.

I've looked at the guidelines from 11/18. If I'm not clear on them,
it's not that I'm not intentionally ignoring them. I'd be fully open
to clarification; but I intended certainly to offer "enough [but not]
too much information", & to identify the issue (& the objective) I've
got in a concise, intelligible way. I'd be glad to include the whole
file; but I figured that would be inconsiderate in comparison to
isolating the code in which I'd guessed the issue was. Instead of
this, I could include links to the files instead (including an example
of the flatfile itself)? I'm not certain if that would be considered
ideal, or inconvenient, by others..

> perldoc -q intersection
> 
> might help.

Only info I got from that was example code, compared to an 'xor
operation'. It could be that I'm not getting it, of course; but I'd
guess it isn't what I'm going for..

> > The interesting thing is this: I've got the following it &output_item:
> > 
> > sub output_item {
> > print <<"OUTPUT";
> > <tr>
> >      <td>$item[0]</td>
> >      <td>$item[1]</td>
> >      <td>$item[2]</td>
> > </tr>
> > OUTPUT
> > }
> > 
> > In the output I'm getting now, there is an increase in table cells if
> > I've input a term that ought to be found in the text file. If I input
> > a term that it won't find, it gives me no table cells. I'm getting
> > this impression by looking at the table border outline cells in the
> > output - it's like it's finding the items in the file & outputting
> > empty table cells like I've indicated if it finds a term; but it's not
> > including the text in $item[0], $item[1], etc. I've got no idea why,
> > or where the issue is, if I'm overlooking the obviuos or not..
> 
> who knows?
> 
> do you have
> 
> use strict;
> 
> and 
> 
> use warnings;
> 
> at the top of your code?

I increasingly feel like I ought to include the whole code in order to
be informative - it's only that it's long enough that I'd be inclined
not to if it that were an option. One way or the other, I'll look for
further info on this first. I'm not interested in wasting others'
time.

Thanks for the input..


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

Date: Wed, 19 Nov 2003 06:24:54 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Include &/or option in flatfile db query..
Message-Id: <slrnbrmo8m.hom.tadmc@magna.augustmail.com>

Oeln <ohmy9od@yahoo.com> wrote:
> "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message news:<Xns9437DD2BD3BC6asu1cornelledu@132.236.56.8>...
>> ohmy9od@yahoo.com (Oeln) wrote in news:ffde43bc.0311162254.298c4521
>> @posting.google.com:

>> >      &output_header;
>> >      &output_open;
>> 
>> Do you know why you have an ampersand preceding the function calls?
>> 
> 
> I figured it was only to indicate it was a function call. Otherwise,
> no. I'd be interested though; I'll look for info on that.


   perldoc perlsub

           &NAME;         # Makes current @_ visible to called subroutine.


Did you _want_ to make the current @_ visible to called subroutines?


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


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

Date: Wed, 19 Nov 2003 13:22:06 -0000
From: "Richard S Beckett" <spikeywan@bigfoot.com.delete.this.bit>
Subject: Inserting the same thing multi times into array.
Message-Id: <bpfqss$r3k$1@newshost.mot.com>

Guys,

To insert 7 'nothings' into an array, I did this:

splice @array, 2, 0,  ("", "", "", "", "", "", "");

This leaves me with ($array[0], $array[1], "", "", "", "", "", "", "",
$array[2], $array[3]...)

Is there a way that I can do something like?:

splice @array, 2, 0, 7*(""); # i.e. 7 lots of ""

Thanks.
-- 
R.
GPLRank +79.699




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

Date: Wed, 19 Nov 2003 13:47:16 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Inserting the same thing multi times into array.
Message-Id: <bpfs94$sfk$1@wisteria.csv.warwick.ac.uk>

"Richard S Beckett" <spikeywan@bigfoot.com.delete.this.bit> wrote:
> To insert 7 'nothings' into an array, I did this:

ITY know the difference between "" and undef (which is a lot closer to
a 'nothing' :).

> splice @array, 2, 0,  ("", "", "", "", "", "", "");
> 
> This leaves me with ($array[0], $array[1], "", "", "", "", "", "", "",
> $array[2], $array[3]...)
> 
> Is there a way that I can do something like?:
> 
> splice @array, 2, 0, 7*(""); # i.e. 7 lots of ""

splice @array, 2, 0, map "", 1..7; #untested

Ben

-- 
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ben@morrow.me.uk ~                   Jorge Luis Borges, 'The Babylon Lottery'


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

Date: Wed, 19 Nov 2003 14:48:29 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Inserting the same thing multi times into array.
Message-Id: <bpfso1$1o3lld$1@ID-184292.news.uni-berlin.de>

Richard S Beckett wrote:
> To insert 7 'nothings' into an array, I did this:
> 
> splice @array, 2, 0,  ("", "", "", "", "", "", "");
> 
> This leaves me with ($array[0], $array[1], "", "", "", "",
> "", "", "", $array[2], $array[3]...)
> 
> Is there a way that I can do something like?:
> 
> splice @array, 2, 0, 7*(""); # i.e. 7 lots of ""

     splice @array, 2, 0, ("")x7;

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: 19 Nov 2003 13:55:18 GMT
From: Ferine Boncer <feralboncer@netscape.net>
Subject: Re: Inserting the same thing multi times into array.
Message-Id: <slrnbrmtea.2fk.feralboncer@auk.jeekay>

Richard S Beckett <spikeywan@bigfoot.com.delete.this.bit> wrote:
>  Guys,
>  
>  To insert 7 'nothings' into an array, I did this:
>  
>  splice @array, 2, 0,  ("", "", "", "", "", "", "");
>  
>  This leaves me with ($array[0], $array[1], "", "", "", "", "", "", "",
>  $array[2], $array[3]...)
>  
>  Is there a way that I can do something like?:
>  
>  splice @array, 2, 0, 7*(""); # i.e. 7 lots of ""

Yes, use the x operator...

Pls do a perldoc perlop and search for 'repeat'

>  
>  Thanks.


-- 
FB


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

Date: Wed, 19 Nov 2003 22:49:03 +1300
From: "Tintin" <me@privacy.net>
Subject: Re: MIME::Lite - From email address to name of the company..
Message-Id: <bpfec1$1nhbvr$1@ID-172104.news.uni-berlin.de>


"John B. Kim" <provicon@earthlink.net> wrote in message
news:1nDub.5461$sb4.698@newsread2.news.pas.earthlink.net...
> I have the code below that sends email with attachment using MIME::Lite:
> ========================================================
> use strict;
> use MIME::Lite;
> use Net::SMTP;
>
> my $from = 'askjinu@yahoo.com';
> my @addweek1 = qw(provicon@earthlink.net
>                   );
> my $Fnameweek1 = 'guide.pdf';
> my $subject='Subject Material';
>
> for my $address (@addweek1) {
>
> my $msg = MIME::Lite->new (
>                From     => $from,
>                To       => $address,
>                Subject  => $subject,
>                Type     =>'multipart/related');
> .......
> =======================================================
> The code is all worked out, and works fine.  But I am trying to better
this
> code by adding just one more change.
> When I send an email using above code, recipients gets my email addresss,
> askjinu@yahoo.com in their mail box.
>
> I wish From information to be JinuAcademy rather than askjinu@yahoo.com.
>
> Can anyone please tell me how to realize this??

Nothing to do with Perl or MIME::Lite and everything to do with mail.

Hint, look at the format of your email, ie: "John B. Kim"
<provicon@earthlink.net>





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

Date: Wed, 19 Nov 2003 10:14:57 GMT
From: "John B. Kim" <provicon@earthlink.net>
Subject: Re: MIME::Lite - From email address to name of the company..
Message-Id: <BoHub.6810$n56.3206@newsread1.news.pas.earthlink.net>

I tried,

    'JinuAcademy <askjinu@yahoo.com>';

But I get the following error message:
    @ or "." expected after "JinuAcademy"

"Tintin" <me@privacy.net> wrote in message
news:bpfec1$1nhbvr$1@ID-172104.news.uni-berlin.de...
>
> "John B. Kim" <provicon@earthlink.net> wrote in message
> news:1nDub.5461$sb4.698@newsread2.news.pas.earthlink.net...
> > I have the code below that sends email with attachment using MIME::Lite:
> > ========================================================
> > use strict;
> > use MIME::Lite;
> > use Net::SMTP;
> >
> > my $from = 'askjinu@yahoo.com';
> > my @addweek1 = qw(provicon@earthlink.net
> >                   );
> > my $Fnameweek1 = 'guide.pdf';
> > my $subject='Subject Material';
> >
> > for my $address (@addweek1) {
> >
> > my $msg = MIME::Lite->new (
> >                From     => $from,
> >                To       => $address,
> >                Subject  => $subject,
> >                Type     =>'multipart/related');
> > .......
> > =======================================================
> > The code is all worked out, and works fine.  But I am trying to better
> this
> > code by adding just one more change.
> > When I send an email using above code, recipients gets my email
addresss,
> > askjinu@yahoo.com in their mail box.
> >
> > I wish From information to be JinuAcademy rather than askjinu@yahoo.com.
> >
> > Can anyone please tell me how to realize this??
>
> Nothing to do with Perl or MIME::Lite and everything to do with mail.
>
> Hint, look at the format of your email, ie: "John B. Kim"
> <provicon@earthlink.net>
>
>
>




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

Date: Wed, 19 Nov 2003 12:44:13 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: MIME::Lite - From email address to name of the company..
Message-Id: <bpfoit$p6u$2@wisteria.csv.warwick.ac.uk>

[don't top-post]

"John B. Kim" <provicon@earthlink.net> wrote:
> "Tintin" <me@privacy.net> wrote in message
> >
> > Hint, look at the format of your email, ie: "John B. Kim"
> > <provicon@earthlink.net>
>
> I tried,
> 
>     'JinuAcademy <askjinu@yahoo.com>';
> 
> But I get the following error message:
>     @ or "." expected after "JinuAcademy"

Try again. Compare

JinuAcademy <askjinu@yahoo.com>

with

"John B. Kim" <provicon@earthlink.net>

 . Spot the difference?

Ben

-- 
Musica Dei donum optimi, trahit homines, trahit deos.    |
Musica truces molit animos, tristesque mentes erigit.    |   ben@morrow.me.uk
Musica vel ipsas arbores et horridas movet feras.        |


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

Date: Wed, 19 Nov 2003 13:55:19 -0000
From: "Roger Moffatt" <news@ducati.demon.co.uk>
Subject: mod_perl win2k mail::sender problem
Message-Id: <bpfsnu$65o$1$8302bc10@news.demon.co.uk>

Hi

Not sure if this is most appropriate forum, but maybe some of the experts
here will have encountered my problem or can redirect me. I've been
searching all morning for a solution on usenet etc but can't get the to
bottom of it.

My environment is;

Apache/2.0.47 (Win32) mod_perl/1.99_10-dev Perl/v5.8.0

My problem seems to relate to sockets under mod_perl on windows. Basically I
am using mail::sender to send e-mail. My code works fine for a few mails if
I restart the Apache server, but soon it stops working and
mail::sender::open fails with an error code indicating "unable to open
connection".

I've seen other people referring to known socket issues with mod_perl and
windows - but I can't seem to find anyone who knows of a solution or
precisely what the problem is.

Can anyone here help?

Regards

Roger
UK





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

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.  

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


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