I Broke a scalar

N

no

Can this be done? Should right? Well its not working =(
What's goin on?

my $a = '
$VAR1 = bless( {
'read_limit' => 3000,
'outbuffer' => '',
'write_limit' => 3000,
'index' => 0,
'inbuffer' => '',
'handle' => bless( \*Symbol::GEN1, 'IO::Socket::INET' ),
'writeonly' => undef,
'eof' => 0,
'choker' => undef,
'choked' => 0,
'error' => 0,
'linemode' => 0,
'sset' => bless( {
'sessions' => {

'IO::Socket::INET=GLOB(0x1a4
c120)' => $VAR1
},
'listen_socket' => bless(
\*Symbol::GEN0, 'I
O::Socket::INET' ),
'writers' => bless( [
undef,
0
], 'IO::Select' ),
'readers' => bless( [
'?',
2,
undef,
undef,
undef,

$VAR1->{'sset'}{'liste
n_socket'},
$VAR1->{'handle'}
], 'IO::Select' )
}, 'IO::LineBufferedSet' )
}, 'IO::LineBufferedSessionData' );
$VAR1 = undef;
';
print $a;
 
A

A. Sinan Unur

Your subject line is devoid of meaning.
Can this be done?

Can what be done?
Should right?

WTF ???
Well its not working =(

ITYM it's not its.

On the other hand, I have no idea what 'it' is that should be working. Care
to enlighten us?
What's goin on?

You are missing a 'g' up there.
my $a = '
$VAR1 = bless( {
'read_limit' => 3000,

OK, so far you have assigned the string

'
$VAR1 = bless( {
'

to $a. Then, you follow that by the bareword read_limit, which is followed
by another string etc etc so on and so forth. Are you by any chance looking
for the q operator?

Please stop the insanity and post a reasonable message that conveys a
meaning. You might want to read and understand

http://www.catb.org/~esr/faqs/smart-questions.html

before you do that.

Sinan.
 
J

Jürgen Exner

Can this be done? Should right? Well its not working =(
What's goin on?

my $a = '
$VAR1 = bless( {
'read_limit' => 3000,
[rest of script snipped]

Well, I don't know what you intended to do, but I get a syntax error

Bad name after read_limit' at t.pl line 3.

What I don't get is why this surprises you.
Maybe you forgot to close the string in the first line?

jue
 
T

thundergnat

Can this be done? Should right? Well its not working =(
What's goin on?

Wow. That's a hell of a scalar.

You're either going to have to escape all of the single quote inside the
scalar, (ugh) or, a much better idea, use qq/ / quoting. See below.


(The more interesting question is WHY you want to have such a scalar...)

my $a = ' my $a = qq/
$VAR1 = bless( {
'read_limit' => 3000,
'outbuffer' => '',
'write_limit' => 3000,
'index' => 0,
'inbuffer' => '',
'handle' => bless( \*Symbol::GEN1, 'IO::Socket::INET' ),
'writeonly' => undef,
'eof' => 0,
'choker' => undef,
'choked' => 0,
'error' => 0,
'linemode' => 0,
'sset' => bless( {
'sessions' => {

'IO::Socket::INET=GLOB(0x1a4
c120)' => $VAR1
},
'listen_socket' => bless(
\*Symbol::GEN0, 'I
O::Socket::INET' ),
'writers' => bless( [
undef,
0
], 'IO::Select' ),
'readers' => bless( [
'?',
2,
undef,
undef,
undef,

$VAR1->{'sset'}{'liste
n_socket'},
$VAR1->{'handle'}
], 'IO::Select' )
}, 'IO::LineBufferedSet' )
}, 'IO::LineBufferedSessionData' );
$VAR1 = undef;
'; /;
print $a;
 
T

thundergnat

Can this be done? Should right? Well its not working =(
What's goin on?


Wow. That's a hell of a scalar.

You're either going to have to escape all of the single quote inside the
scalar, (ugh) or, a much better idea, use q/ / quoting. See below.


(The more interesting question is WHY you want to have such a scalar...)

my $a = '

my $a = q/
$VAR1 = bless( {
'read_limit' => 3000,
'outbuffer' => '',
'write_limit' => 3000,
'index' => 0,
'inbuffer' => '',
'handle' => bless( \*Symbol::GEN1, 'IO::Socket::INET' ),
'writeonly' => undef,
'eof' => 0,
'choker' => undef,
'choked' => 0,
'error' => 0,
'linemode' => 0,
'sset' => bless( {
'sessions' => {

'IO::Socket::INET=GLOB(0x1a4
c120)' => $VAR1
},
'listen_socket' => bless( \*Symbol::GEN0, 'I
O::Socket::INET' ),
'writers' => bless( [
undef,
0
], 'IO::Select' ),
'readers' => bless( [
'?',
2,
undef,
undef,
undef,

$VAR1->{'sset'}{'liste
n_socket'},
$VAR1->{'handle'}
], 'IO::Select' )
}, 'IO::LineBufferedSet' )
}, 'IO::LineBufferedSessionData' );
$VAR1 = undef;
';
/;

print $a;
 
J

Joe Smith

{ 'sessions' => {
'IO::Socket::INET=GLOB(0x1a4
c120)' => $VAR1 },

That part is completely screwed up; it can never work that way.

Please explain what you're trying to do.
Please explain what you mean by "I Broke a scalar"; that makes no sense.
-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top