[30256] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1499 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 1 14:14:25 2008

Date: Thu, 1 May 2008 11:14:16 -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           Thu, 1 May 2008     Volume: 11 Number: 1499

Today's topics:
        Stuffing @users into $self->{'users'} <Phillip.Ross.Taylor@gmail.com>
    Re: Stuffing @users into $self->{'users'} <Phillip.Ross.Taylor@gmail.com>
    Re: Stuffing @users into $self->{'users'} <simon.chao@fmr.com>
    Re: Stuffing @users into $self->{'users'} <Phillip.Ross.Taylor@gmail.com>
    Re: Stuffing @users into $self->{'users'} <1usa@llenroc.ude.invalid>
    Re: Stuffing @users into $self->{'users'} xhoster@gmail.com
    Re: Stuffing @users into $self->{'users'} <Phillip.Ross.Taylor@gmail.com>
    Re: Stuffing @users into $self->{'users'} <Phillip.Ross.Taylor@gmail.com>
    Re: Stuffing @users into $self->{'users'} <1usa@llenroc.ude.invalid>
    Re: Stuffing @users into $self->{'users'} <glex_no-spam@qwest-spam-no.invalid>
    Re: use perl to draw Venn Diagram <zentara@highstream.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 1 May 2008 06:46:00 -0700 (PDT)
From: Philluminati <Phillip.Ross.Taylor@gmail.com>
Subject: Stuffing @users into $self->{'users'}
Message-Id: <28276b33-64d9-4cc3-8e20-d397ef81f81f@k13g2000hse.googlegroups.com>


Hi everyone.

I'm writing a SOAP Server in perl and I need/want to use objects. I
have an array called @users which is populated in sub new. I want to
store this array in my $self variable which is passed to all functions
and then pull it out later. Can somebody help me?

sub new
{
        my ($class_name) = @_;
        my ($self) = {};
        bless ($self, $class_name);

        my $phill = new user;
        $phill->setId(6);
        $phill->setUsername("ptaylor");
        $phill->setPassword("password");
        $phill->setSessionKey("");

        #cut some code out to stop the post being enormous.

        my @users = ( $phill );

        $self->{'users'} = [ @users ];

        return $self;

}
sub login
{
        my ($self, $username, $password) = @_;
        my @users = @$self->{'users'};                         #<--
THIS IS LINE 62

        foreach my $user (@users)

        #more code....
}

how I get this message in my VB Soap Client:

Can't use string ("user_management") as an ARRAY ref while "strict
refs" in use at user_management.pm line 62.

Phill


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

Date: Thu, 1 May 2008 06:49:09 -0700 (PDT)
From: Philluminati <Phillip.Ross.Taylor@gmail.com>
Subject: Re: Stuffing @users into $self->{'users'}
Message-Id: <33029ea2-d783-4fea-9e4c-6cfbaa45392d@l42g2000hsc.googlegroups.com>

My question is how to I put an array into a hash (if $self is one. I
don't really know) and how do I get it out again intact?

Philluminati wrote:
> Hi everyone.
>
> I'm writing a SOAP Server in perl and I need/want to use objects. I
> have an array called @users which is populated in sub new. I want to
> store this array in my $self variable which is passed to all functions
> and then pull it out later. Can somebody help me?
>
> sub new
> {
>         my ($class_name) = @_;
>         my ($self) = {};
>         bless ($self, $class_name);
>
>         my $phill = new user;
>         $phill->setId(6);
>         $phill->setUsername("ptaylor");
>         $phill->setPassword("password");
>         $phill->setSessionKey("");
>
>         #cut some code out to stop the post being enormous.
>
>         my @users = ( $phill );
>
>         $self->{'users'} = [ @users ];
>
>         return $self;
>
> }
> sub login
> {
>         my ($self, $username, $password) = @_;
>         my @users = @$self->{'users'};                         #<--
> THIS IS LINE 62
>
>         foreach my $user (@users)
>
>         #more code....
> }
>
> how I get this message in my VB Soap Client:
>
> Can't use string ("user_management") as an ARRAY ref while "strict
> refs" in use at user_management.pm line 62.
>
> Phill


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

Date: Thu, 1 May 2008 07:06:16 -0700 (PDT)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: Stuffing @users into $self->{'users'}
Message-Id: <9fc25106-4685-4e62-ad1d-e0ffe5488a7c@m45g2000hsb.googlegroups.com>

On May 1, 9:46=A0am, Philluminati <Phillip.Ross.Tay...@gmail.com> wrote:
> Hi everyone.
>
> I'm writing a SOAP Server in perl and I need/want to use objects. I
> have an array called @users which is populated in sub new. I want to
> store this array in my $self variable which is passed to all functions
> and then pull it out later. Can somebody help me?
>
> sub new
> {
> =A0 =A0 =A0 =A0 my ($class_name) =3D @_;
> =A0 =A0 =A0 =A0 my ($self) =3D {};
> =A0 =A0 =A0 =A0 bless ($self, $class_name);
>
> =A0 =A0 =A0 =A0 my $phill =3D new user;
> =A0 =A0 =A0 =A0 $phill->setId(6);
> =A0 =A0 =A0 =A0 $phill->setUsername("ptaylor");
> =A0 =A0 =A0 =A0 $phill->setPassword("password");
> =A0 =A0 =A0 =A0 $phill->setSessionKey("");
>
> =A0 =A0 =A0 =A0 #cut some code out to stop the post being enormous.
>
> =A0 =A0 =A0 =A0 my @users =3D ( $phill );
>
> =A0 =A0 =A0 =A0 $self->{'users'} =3D [ @users ];
>
> =A0 =A0 =A0 =A0 return $self;
>
> }
>
> sub login
> {
> =A0 =A0 =A0 =A0 my ($self, $username, $password) =3D @_;
> =A0 =A0 =A0 =A0 my @users =3D @$self->{'users'}; =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 #<--
> THIS IS LINE 62
>
> =A0 =A0 =A0 =A0 foreach my $user (@users)
>
> =A0 =A0 =A0 =A0 #more code....
>
> }
>
> how I get this message in my VB Soap Client:
>
> Can't use string ("user_management") as an ARRAY ref while "strict
> refs" in use at user_management.pm line 62.

This message means that $self->{'users'} is returning a string, and
not an arrayref, so you can't dereference it as an array.

>
> My question is how to I put an array into a hash (if $self is one. I
> don't really know) and how do I get it out again intact?

If by 'put an array into a hash' you mean assign an arrayref value to
a hash key, then:

my @ar =3D qw( 1 two blue );
$hash{'key'} =3D \@ar;

or

$hash{'key'} =3D [ 'hello', 'world' ];


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

Date: Thu, 1 May 2008 07:29:16 -0700 (PDT)
From: Philluminati <Phillip.Ross.Taylor@gmail.com>
Subject: Re: Stuffing @users into $self->{'users'}
Message-Id: <661262f3-aea5-4734-906e-7062d77f201f@m44g2000hsc.googlegroups.com>

On May 1, 3:06 pm, nolo contendere <simon.c...@fmr.com> wrote:
> On May 1, 9:46 am, Philluminati <Phillip.Ross.Tay...@gmail.com> wrote:
>
>
>
> > Hi everyone.
>
> > I'm writing a SOAP Server in perl and I need/want to use objects. I
> > have an array called @users which is populated in sub new. I want to
> > store this array in my $self variable which is passed to all functions
> > and then pull it out later. Can somebody help me?
>
> > sub new
> > {
> >         my ($class_name) = @_;
> >         my ($self) = {};
> >         bless ($self, $class_name);
>
> >         my $phill = new user;
> >         $phill->setId(6);
> >         $phill->setUsername("ptaylor");
> >         $phill->setPassword("password");
> >         $phill->setSessionKey("");
>
> >         #cut some code out to stop the post being enormous.
>
> >         my @users = ( $phill );
>
> >         $self->{'users'} = [ @users ];
>
> >         return $self;
>
> > }
>
> > sub login
> > {
> >         my ($self, $username, $password) = @_;
> >         my @users = @$self->{'users'};                         #<--
> > THIS IS LINE 62
>
> >         foreach my $user (@users)
>
> >         #more code....
>
> > }
>
> > how I get this message in my VB Soap Client:
>
> > Can't use string ("user_management") as an ARRAY ref while "strict
> > refs" in use at user_management.pm line 62.
>
> This message means that $self->{'users'} is returning a string, and
> not an arrayref, so you can't dereference it as an array.
>
>
>
> > My question is how to I put an array into a hash (if $self is one. I
> > don't really know) and how do I get it out again intact?
>
> If by 'put an array into a hash' you mean assign an arrayref value to
> a hash key, then:
>
> my @ar = qw( 1 two blue );
> $hash{'key'} = \@ar;
>
> or
>
> $hash{'key'} = [ 'hello', 'world' ];

Ok, thanks dude. So if I have my code do this:

$self->{'users'} = \@users;

how do I pull the data out again later when I need it?

I've tried:

my @users = ref $self->{'users'}; //same message as above
my @users = @$self->{'users'};
my @users = \$self->{'users'};
my @users = map $self->{'users'};  //gave 500 internal server err
my @users = ( $self->{'users'} ); //same as original err
my @users = scalar $self->{'users'};

I have no idea what the hell I'm doing or what any of these keywords
mean. All I want to do is pull that array back into a variable. Anyone?


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

Date: Thu, 01 May 2008 14:44:18 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Stuffing @users into $self->{'users'}
Message-Id: <Xns9A916D3A942F1asu1cornelledu@127.0.0.1>

Philluminati <Phillip.Ross.Taylor@gmail.com> wrote in news:661262f3-
aea5-4734-906e-7062d77f201f@m44g2000hsc.googlegroups.com:

> my @users = ref $self->{'users'}; //same message as above
> my @users = @$self->{'users'};
> my @users = \$self->{'users'};
> my @users = map $self->{'users'};  //gave 500 internal server err
> my @users = ( $self->{'users'} ); //same as original err
> my @users = scalar $self->{'users'};

You are ignoring the fact that programming is a deterministic endeavor. 
Successful programmers are not those who throw a bazillion variations at 
a wall and see what sticks.

> I have no idea what the hell I'm doing or what any of these keywords
> mean.

Well, this would be the time to learn then, wouldn't it?

You can start by buying yourself a beginners' Perl book, oh, I don't 
know, "Learning Perl" might work 
(http://www.oreilly.com/catalog/lperl3/)

At the very least, you should have read:

perldoc perlreftut
perldoc perldsc

> All I want to do is pull that array back into a variable. Anyone?

If $x is a reference to an array, then @{ $x } dereferences it.

my @users = @{ $self->{users} };

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://www.rehabitation.com/clpmisc/


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

Date: 01 May 2008 15:16:25 GMT
From: xhoster@gmail.com
Subject: Re: Stuffing @users into $self->{'users'}
Message-Id: <20080501111627.300$T5@newsreader.com>

Philluminati <Phillip.Ross.Taylor@gmail.com> wrote:
> Hi everyone.
>
> I'm writing a SOAP Server in perl and I need/want to use objects. I
> have an array called @users which is populated in sub new. I want to
> store this array in my $self variable which is passed to all functions
> and then pull it out later. Can somebody help me?
>
> sub new
> {
>         my ($class_name) = @_;
>         my ($self) = {};
>         bless ($self, $class_name);
>
>         my $phill = new user;
>         $phill->setId(6);
>         $phill->setUsername("ptaylor");
>         $phill->setPassword("password");
>         $phill->setSessionKey("");
>
>         #cut some code out to stop the post being enormous.
>
>         my @users = ( $phill );

@users will hold exactly one thing, $phill.  Why use an array for that?

>
>         $self->{'users'} = [ @users ];
>
>         return $self;
>
> }
> sub login
> {
>         my ($self, $username, $password) = @_;
>         my @users = @$self->{'users'};                         #<--
> THIS IS LINE 62
>
>
> how I get this message in my VB Soap Client:
>
> Can't use string ("user_management") as an ARRAY ref while "strict
> refs" in use at user_management.pm line 62.

The problem is in some part of the code you didn't show us.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Thu, 1 May 2008 08:26:24 -0700 (PDT)
From: Philluminati <Phillip.Ross.Taylor@gmail.com>
Subject: Re: Stuffing @users into $self->{'users'}
Message-Id: <8b2af9d0-1f51-48be-ae8a-3c9fa9f265a0@d1g2000hsg.googlegroups.com>

On May 1, 4:16 pm, xhos...@gmail.com wrote:
> Philluminati <Phillip.Ross.Tay...@gmail.com> wrote:
> > Hi everyone.
>
> > I'm writing a SOAP Server in perl and I need/want to use objects. I
> > have an array called @users which is populated in sub new. I want to
> > store this array in my $self variable which is passed to all functions
> > and then pull it out later. Can somebody help me?
>
> > sub new
> > {
> >         my ($class_name) = @_;
> >         my ($self) = {};
> >         bless ($self, $class_name);
>
> >         my $phill = new user;
> >         $phill->setId(6);
> >         $phill->setUsername("ptaylor");
> >         $phill->setPassword("password");
> >         $phill->setSessionKey("");
>
> >         #cut some code out to stop the post being enormous.
>
> >         my @users = ( $phill );
>
> @users will hold exactly one thing, $phill.  Why use an array for that?
>
>
>
>
>
> >         $self->{'users'} = [ @users ];
>
> >         return $self;
>
> > }
> > sub login
> > {
> >         my ($self, $username, $password) = @_;
> >         my @users = @$self->{'users'};                         #<--
> > THIS IS LINE 62
>
> > how I get this message in my VB Soap Client:
>
> > Can't use string ("user_management") as an ARRAY ref while "strict
> > refs" in use at user_management.pm line 62.
>
> The problem is in some part of the code you didn't show us.
>
> Xho
>
> --
> --------------------http://NewsReader.Com/--------------------
> The costs of publication of this article were defrayed in part by the
> payment of page charges. This article must therefore be hereby marked
> advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
> this fact.

The array only held one value because I didn't want to post an
enourmous block of text. Anyway here is the entire copy of the code.
Each instance gets an array of three people called @users. It's shoved
into $self->{'users'}. Then in each function I want to pull it out
again but I can't seem to do it. The query functions shows there are
no users what so ever in the array:

#!/usr/bin/perl -w

package user_management;

use user;
#use strict;

sub new
{
        my ($class_name) = @_;

        my ($self) = {};
        bless ($self, $class_name);

	#some objects for the array
	my $phill = new user;
	$phill->setId(6);
	$phill->setUsername("ptaylor");
	$phill->setPassword("password");
	$phill->setSessionKey("");

	my $simon = new user;
	$simon->setId(7);
	$simon->setUsername("sroberts");
	$simon->setPassword("cheese");
	$simon->setSessionKey("");

	my $nick = new user;
	$nick->setId(8);
	$nick->setUsername("nick");
	$nick->setPassword("rock");
	$nick->setSessionKey("");

	#put them in the array
	my @users = ( $phill, $simon, $nick );

	$self->{'users'} = \@users;  #put the array in an instance variable
(or perl equiv)
	$self->{'nextSessionId'} = 1;

        return $self;

}

sub login
{
	my ($self, $username, $password) = @_;

	#print "usr: $username\npwd: $password\n";
	#my $size = @users;
	#;return "ERR: Count is $size";
	#return "ERR: I GOT $username, $password";
	my @users = @{ $self->{'users'} };

	foreach my $user (@users)
	{
		if ($user->getUsername() eq $username)
		{
			if ($user->getPassword() eq $password)
			{
				if ($user->getSessionKey ne "")
				{
					return "ERR: User already logged in";
				}
				else
				{
					#generate session key
					$user->setSessionKey("SESS" . $self->{'nextSessionId'});
					$self->{'nextSessionId'} = $self->{'nextSessionId'} + 1;
					return $user->getSessionKey();
				}
			}
			else
			{	return "ERR: Password is wrong"; }
		}
	}

	return "ERR: No users";
}

sub query
{
	my $self = shift;
	my @users =  @{ $self->{'users'} };
	my $active = 0;
	my $total = @users;
	my $retval = "";

	foreach my $usr (@users)
	{
		if ($usr->getSessionKey() ne "")
		{
			$retval = $retval . "user " . $usr->getUsername() . " logged in\n";
			$active++;
		}
		else
		{
			$retval = $retval . "user " . $usr->getUsername() . " logged out
\n";
		}
	}

	return "$retval$active of $total";
}

sub logout
{
	my ($self, $sessionKey) = @_;
	my @users = @{ $self->{'users'} };

	foreach my $usr (@users)
	{
		if ($usr->getSessionKey() eq $sessionKey)
		{
			$usr->setSessionKey("");
			return 1;
		}
	}

	return 0;
}

1;


--

Before anyone makes a note of it - I am aware that each instance of
the user_management object will get a duplicate array. This isn't my
primary concern at the moment however. I just want to be able to store
arrays inside object instances.


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

Date: Thu, 1 May 2008 08:33:49 -0700 (PDT)
From: Philluminati <Phillip.Ross.Taylor@gmail.com>
Subject: Re: Stuffing @users into $self->{'users'}
Message-Id: <88d3bafd-cd30-464b-9ee1-ec646df8d8b2@b64g2000hsa.googlegroups.com>

On May 1, 3:44 pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
> Philluminati <Phillip.Ross.Tay...@gmail.com> wrote in news:661262f3-
> aea5-4734-906e-7062d77f2...@m44g2000hsc.googlegroups.com:
>
> > my @users = ref $self->{'users'}; //same message as above
> > my @users = @$self->{'users'};
> > my @users = \$self->{'users'};
> > my @users = map $self->{'users'};  //gave 500 internal server err
> > my @users = ( $self->{'users'} ); //same as original err
> > my @users = scalar $self->{'users'};
>
> You are ignoring the fact that programming is a deterministic endeavor.
> Successful programmers are not those who throw a bazillion variations at
> a wall and see what sticks.
>
> > I have no idea what the hell I'm doing or what any of these keywords
> > mean.
>
> Well, this would be the time to learn then, wouldn't it?
>
> You can start by buying yourself a beginners' Perl book, oh, I don't
> know, "Learning Perl" might work
> (http://www.oreilly.com/catalog/lperl3/)
>
> At the very least, you should have read:
>
> perldoc perlreftut
> perldoc perldsc
>
> > All I want to do is pull that array back into a variable. Anyone?
>
> If $x is a reference to an array, then @{ $x } dereferences it.
>
> my @users = @{ $self->{users} };
>
> Sinan
>
> --
> A. Sinan Unur <1...@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
>
> comp.lang.perl.misc guidelines on the WWW:http://www.rehabitation.com/clpmisc/

I already own programming perl by Larry Wall. It's sitting here on my
desk. However it happens to be over 900 pages and the author spends
all his time setting up jokes and "funny" lines of code rather than
actually explain in programming terms what the hell is going on. I'm
more gutted I brought this book than the time I dropped my wallet down
a drain. That tells you something.

Page 245: "the backslash operator. "The operator works like the &
(address-of) operator in C -- at least at first glance."

-- Well I know C and I know how to use the address of operator, so how
do I deference it? No...the authors off telling you what other "clever
little lines of code" you can make with Perl.

$coderef = sub { print "Boink\n" };

Wow this is awesome. Turn the page and you learn how to "bless your
doggie". I'm sold. I mean that's on line 245...The chapter on data
structures starts on page 269 man. Surely data structures are more
important than anonymous functions?

Look I know I am going to have to read the book no matter how much of
a frustrating read it is. However I do want to get this prototype
running prior to my intellectual investment. I don't want to read 900
pages when effectively the prototype I'm writing is going to say
whether the language is feasible or not, not my willingness or
unwillingness to learn it.


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

Date: Thu, 01 May 2008 15:56:20 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Stuffing @users into $self->{'users'}
Message-Id: <Xns9A917970410BBasu1cornelledu@127.0.0.1>

Philluminati <Phillip.Ross.Taylor@gmail.com> wrote in
news:88d3bafd-cd30-464b-9ee1-ec646df8d8b2@b64g2000hsa.googlegroups.com: 

> On May 1, 3:44 pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
>> Philluminati <Phillip.Ross.Tay...@gmail.com> wrote in news:661262f3-
>> aea5-4734-906e-7062d77f2...@m44g2000hsc.googlegroups.com:

 ...

>> > All I want to do is pull that array back into a variable. Anyone?
>>
>> If $x is a reference to an array, then @{ $x } dereferences it.
>>
>> my @users = @{ $self->{users} };
>>
>> Sinan
>>
>> --
>> A. ...

Do not quote sigs.
 
<snip rant>

In your haste, you seem to have missed the answer to your question.

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://www.rehabitation.com/clpmisc/


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

Date: Thu, 01 May 2008 12:59:00 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Stuffing @users into $self->{'users'}
Message-Id: <481a04e4$0$33227$815e3792@news.qwest.net>

		Philluminati wrote:

> package user_management;

Generally you don't want a lower case name for your package.

> 
> use user;
> #use strict;

Why comment that out?

> 
> sub new
> {
>         my ($class_name) = @_;
> 
>         my ($self) = {};
>         bless ($self, $class_name);
Little cleaner as:

my $self = bless {}, $class_name;

> 
> 	#some objects for the array

This stuff would typically be found in an init method, or
passed in to new or something other than having new
create it. Keep your new method short and simple.

> 	my $phill = new user;
> 	$phill->setId(6);
> 	$phill->setUsername("ptaylor");
> 	$phill->setPassword("password");
> 	$phill->setSessionKey("");
[...]
> 
> 	#put them in the array
> 	my @users = ( $phill, $simon, $nick );
> 
> 	$self->{'users'} = \@users;  #put the array in an instance variable
> (or perl equiv)

You might want to create an add_user method, instead of doing that. e.g.

$self->add_user( $phill );

That way it'd be much easier to test also.  You would call the add_user
from whatever is using this class.


> 	$self->{'nextSessionId'} = 1;

Probably want a nextSessionId and/or sessionId method for that too.

> 
>         return $self;
> 
> }
> 
> sub login
> {
> 	my ($self, $username, $password) = @_;

> 	my @users = @{ $self->{'users'} };

Create a get_user method.

> 
> 	foreach my $user (@users)

You probably want to use a hashref, instead of an array, that
way you have one look-up instead of iterating over many
@users.

> 	{
> 		if ($user->getUsername() eq $username)
> 		{
> 			if ($user->getPassword() eq $password)
> 			{
> 				if ($user->getSessionKey ne "")
>

]...]
> --
> 
> Before anyone makes a note of it - I am aware that each instance of
> the user_management object will get a duplicate array. This isn't my
> primary concern at the moment however. I just want to be able to store
> arrays inside object instances.

Based on your code above, using a hash would be much more efficient.


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

Date: Thu, 01 May 2008 14:13:36 GMT
From: zentara <zentara@highstream.net>
Subject: Re: use perl to draw Venn Diagram
Message-Id: <3kjj14d2im8qr8pa90umtfmrjptk0ukoih@4ax.com>

On Wed, 30 Apr 2008 13:17:01 -0500, Ted Zlatanov <tzz@lifelogs.com>
wrote:
>
>z> If you need to do this without X, you might want to look at the Cairo
>z> module
>z> http://cairographics.org/samples/
>
>z> You can save them to many file formats. Gtk2's graphics are based
>z> on Cairo.
>
>Also the OP may want to consider Matlab's own scripting abilities which
>are pretty decent.
>Ted

As well as just writing postscript, then converting them to jpg or
whatever.

Perl can be used to write postscript or pdf, and making circles
is as easy as drawing lines. Just google for "postscript circles"
For example:
http://www.physics.emory.edu/~weeks/graphics/howtops2.html


zentara

-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


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

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 V11 Issue 1499
***************************************


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