comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
March 2008
motuwethfrsasuw
     12 9
3456789 10
10111213141516 11
17181920212223 12
24252627282930 13
31       14
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Outlook -- email         


Author: cmiller
Date: Mar 6, 2008 22:40

For anyone looking for a way around the Outlook pop up security box,
there is a program called ClickYes that can be installed which will
solve the problem. It will reside on your task bar and deal with the
pop-up window. Hope this helps.
1 Comment
  Sending using Net::IRC         


Author: deadpickle
Date: Mar 6, 2008 21:58

I am wondering is there a way to SEND PRIVMSG's to the channel
(therefore making them public) using the module Net::IRC? This modeule
does everything I need EXCEPT this, so if someone knows how to do this
I would be forever greatful.
2 Comments
  FAQ 5.4 How can I use Perl's "-i" option from within a program?         


Author: PerlFAQ Server
Date: Mar 6, 2008 18:03

This is an excerpt from the latest version perlfaq5.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

5.4: How can I use Perl's "-i" option from within a program?

"-i" sets the value of Perl's $^I variable, which in turn affects the
behavior of "<>"; see perlrun for more details. By modifying the
appropriate variables directly, you can get the same behavior within a
larger program. For example:
Show full article (1.97Kb)
no comments
  \@ and \&         


Author: Rose
Date: Mar 6, 2008 18:01

Yesterday I was taught that I can use

\@array to refer an array and it does not make a copy of itself.

Indeed i don't quite understand what it means.

Today, I encounter another mysterious symbol \&, could anybody tell me what
\ and & are for?

my %%sorted_features;
for my $f (@features) {
my $tag = $f->primary_tag;
push @{$sorted_features{$tag}},$f;
}

if ($sorted_features{obj}) {
$panel->add_track($sorted_features{obj},
$panel->add_track(-label => \&Label,);
}

sub Label
{
my $feature = shift;
Show full article (0.70Kb)
9 Comments
  How to pass a range (2 .. 42) by Getopt::Long to a script?         


Author: Tom Brown
Date: Mar 6, 2008 15:38

Hello.

The following range is "hardcoded" in a script.

for my $range ( 13 .. 20 ) {
...
}

Now, I would like pass the range dynamically as option (Getopt::Long)
to the script in order to avoid the changes in the script itself. What
is the appropriate solution?

Thanks in advance.

Tom
3 Comments
  sample client server socket issue         


Author: jm
Date: Mar 6, 2008 14:35

I have written some perl client program and javascript server program.

Communication seams working in both direction, but the perl client
cannot read final data.

Perl use socket in blocking mode (default).
I open the connection with localhost, port number, and tcp.

When I read packets with a size of 512 or 4096, everything works fine
till the last packet. As the last packet is smaller than 4096, perl stay
blocked waiting for a complete packet.

I just want it to be blocked when no byte is available.

When I do not use a size of 512 or 4096, but a size of 1, everything
works fine, but I am wondering if it will not be too much slow.

my $buffer = '';
while ( not $buffer =~ /\n\n/ )
{
my $packet;
sysread $sock, $packet, 4096 ;
$buffer .= $packet ;
}
Show full article (0.91Kb)
8 Comments
  FAQ 4.76 How do I pack arrays of doubles or floats for XS code?         


Author: PerlFAQ Server
Date: Mar 6, 2008 12:03

This is an excerpt from the latest version perlfaq4.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

4.76: How do I pack arrays of doubles or floats for XS code?

The kgbpack.c code in the "PGPLOT" module on CPAN does just this. If
you're doing a lot of float or double processing, consider using the
"PDL" module from CPAN instead--it makes number-crunching easy.

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

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.
Show full article (1.25Kb)
no comments
  regexp for s///         


Author: Petr Vileta
Date: Mar 6, 2008 09:30

I need to write regexp for s/// subtitution but I can't to thinkup it. Can
anybody help me?

I have string with possible 3 values:

$string = "A: aaa B: bbb";
or
$string = "A: aaa";
or
$string = "B: bbb";

Now I want to create 2 variables called $myA and $myB and want to store values
to both variables depend on found or not found A and B in $string.
Show full article (1.02Kb)
16 Comments
  scalar context for testing arguments         


Author: fvdmarkt
Date: Mar 6, 2008 08:10

Hi,

Is this the right way to test for existence of arguments?

if (@ARGV > 0) {
}

or should I use the index of the last argument?

if ($#ARGV >= 0) {
}

Who has a better suggestion?
1 Comment
  Conditional compilation         


Author: Wcool
Date: Mar 6, 2008 06:57

Hi,

From the chapter on internal workings of Perl in the Perl book, I
think it should be possible to conditionally compile something based
on a variable.

I have the following real problem: my code has a lot of statements
that conditionally print a tracing message.
That is based on a command line parameter.

Is it possible during the compilation phase to NOT generate any code
for those statements if that command line is not set.
Example:

sub Trace
{
my ($debug, $msg) = @_;

if ($debug) {
print $msg."\n";
}
}
Show full article (1.00Kb)
3 Comments
1 2