PDA

View Full Version : Increasing size limit for perl variable



pardeepluna
November 15th, 2008, 11:45 AM
Hi All..

Please direct me if i have posted on wrong thread .

I want to know , How can we increase the size limit for perl variable.

$size = <stdin>

here while i am trying to give more than 256 char in the stdin i am getting output after terminating first 256.i.e i am getting output as 256 onward.

nvteighen
November 15th, 2008, 12:58 PM
Hi All..

Please direct me if i have posted on wrong thread .

I want to know , How can we increase the size limit for perl variable.

$size = <stdin>

here while i am trying to give more than 256 char in the stdin i am getting output after terminating first 256.i.e i am getting output as 256 onward.

Er... Are you sure? I've entered a ~320 char long string and no problem...

unutbu
November 15th, 2008, 12:59 PM
#!/usr/bin/perl
use strict;
use warnings;

my $size=<STDIN>;
my $len=length($size);
print "$len\n",;
print "$size\n"
Can you show us your code? I'm unable to reproduce the problem.

indecisive
November 15th, 2008, 04:02 PM
I can not replicate it either. One principle of Perl is "No Unnecessary Limits," so I doubt that problem is genuine. Perl's variables should, after all, be as large as necessary until they fill the memory.