ISDN one more time, and an off-topic (perl) question.

2001-03-25 Thread Oded Arbel

Hi list!

I have a simple perl question, if you please :
I have a function that needs to return a hash (%) to the caller - it does so
something like this :
snip
return %temp;
/snip
and I call it like this :
snip
%result = subname(params);
/snip
now, I want to detect when that functin fails completly, so - when it does
this, it returns a non-defined value :
snip
return undef.
/snip
and now when I try to detect it :
snip
if (!defined %result) {
/snip
it ofcourse doesn't work. so my question is - how should I try to detect the
undefined value ?

and on a slightly more on-topic question -
I'm still having problems with my ISDN card - I had to reinstall the system
(not because of the card, but because I horribly crashed it a few times and
fsck was giving me trouble, so I wanted to do something I should have done a
long time ago - reformat root with reiserFS :-), Mandrake 7.2 like before
(only now it's back to vanila - no new kernel, kde or glibc), and I even
tried to use 'draknet' to configure my ISDN card - but I don't know how to
activate it after I did that.
isdn4linux give me trouble - when I run it with some options - like 'isdn
net setup' it complains about missing files in the documentation directory
or something, and kISDN, after properly configuring it , acts the same as
with my own handmade scripts -
it loads the modules properly, sets everything up without a complaint, and
then when I dial out, it does 3 tries and fails. sometimes returning error
E001B (with kISDN I even got once an E0010 error).
When I tried to dial with minicom and the modem emulation (/dev/ttyI0) I get
BUSY responses - I dial and then it takes sometime (much more time then I
think and ISDN should take) and returns BUSY, or - sometimes - it returns
BUSY immidietly (after much less time then I think ISDN should take).

The card in question is the venerable Fritz!PCI on an AOpen PX64+ board with
a  P2-233 processor, running a vanila Mandrake 7.2.

My next option, which I'm gonna try when I get home today, is to add another
HDD with Win98 installed, try to dial-up, and if I fail - get technical
support from my ISP. if I succeed connecting with Win98 I'll be very
disapointed.

Speaking of technical support (and linux ;-) here are two horror stories :

1) I registered to Netvision, in an attempt to get techincal support for
linux, clearly stating to the sales person a few times that linux support is
the only reason I'm registering, and she assured me that its no problem. a
few days later when I called and asked for technical support I was told that
Netvision _closed_ their linux support section a month ago !

2) so I registered to Actcom - which is the only other ISP I'm aware of that
promised linux technical support. I took their "not so cheap, but ok", again
making sure that I can get linux support with that, and a few days later,
when I called for tech support, I was told by the nice support person that
no ISP does linux support in Israel, and Actcom can't help me with my ISDN
either. he was nice enough to tell me he will try to help and call back -
though he never did :-)
I didn't really understand if Actcom doesn't give linux tech-support at all,
or just not for ISDN connections.

Oded

--
Police: "You're under arrest for murder."
PC: "It wasn't me! Just ask them; they were there when I did it!"
 -- Top20 one-liners




=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]




Re: ISDN one more time, and an off-topic (perl) question.

2001-03-25 Thread Shlomi Fish

On Sun, 25 Mar 2001, Oded Arbel wrote:

 Hi list!
 
 I have a simple perl question, if you please :
 I have a function that needs to return a hash (%) to the caller - it does so
 something like this :
 snip
 return %temp;
 /snip
 and I call it like this :
 snip
 %result = subname(params);
 /snip
 now, I want to detect when that functin fails completly, so - when it does
 this, it returns a non-defined value :
 snip
 return undef.
 /snip
 and now when I try to detect it :
 snip
 if (!defined %result) {
 /snip
 it ofcourse doesn't work. so my question is - how should I try to detect the
 undefined value ?


I advise you to pass the Hash as a reference. Like this:

sub myfunc
{
...

return \%temp;
}

And then

$hash_ref = myfunc();

Then you can check if $hash_ref is undef. If it's not: you can dereference
it into a hash:

%hash = %{$hash_ref};

For more information consult the perlref manpage.

Hope it helps.

Shlomi Fish

--
Shlomi Fish[EMAIL PROTECTED] 
Home Page: http://t2.technion.ac.il/~shlomif/
Home E-mail:   [EMAIL PROTECTED]

The prefix "God Said" has the extraordinary logical property of 
converting any statement that follows it into a true one.


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]




Re: ISDN one more time (and an off-topic (perl) question).

2001-03-25 Thread shaulka

On Sun, Mar 25, 2001 at 10:56:46AM +0200, Oded Arbel wrote:
 Hi list!
 
 I have a simple perl question, if you please :
 I have a function that needs to return a hash (%) to the caller - it does so
 something like this :
 snip
 return %temp;
 /snip
 and I call it like this :
 snip
 %result = subname(params);
 /snip
 now, I want to detect when that function fails completely, so - when it does
 this, it returns a non-defined value :
 snip
 return undef.
 /snip
 and now when I try to detect it :
 snip
 if (!defined %result) {
 /snip
 it of course doesn't work. so my question is - how should I try to detect the
 undefined value ?
 
 and on a slightly more on-topic question -
 I'm still having problems with my ISDN card - I had to reinstall the system
 (not because of the card, but because I horribly crashed it a few times and
 fsck was giving me trouble, so I wanted to do something I should have done a
 long time ago - reformat root with reiserFS :-), Mandrake 7.2 like before
 (only now it's back to vanilla - no new kernel, kde or glibc), and I even
 tried to use 'draknet' to configure my ISDN card - but I don't know how to
 activate it after I did that.
 isdn4linux give me trouble - when I run it with some options - like 'isdn
 net setup' it complains about missing files in the documentation directory
 or something, and kISDN, after properly configuring it , acts the same as
 with my own handmade scripts -
 it loads the modules properly, sets everything up without a complaint, and
 then when I dial out, it does 3 tries and fails. sometimes returning error
 E001B (with kISDN I even got once an E0010 error).
 When I tried to dial with minicom and the modem emulation (/dev/ttyI0) I get
 BUSY responses - I dial and then it takes sometime (much more time then I
 think and ISDN should take) and returns BUSY, or - sometimes - it returns
 BUSY immidietly (after much less time then I think ISDN should take).
 


1) What response do you get when you try the ati command in minicom?
Not sure about that, but where you tried to call an ISDN number? If not then try one 
(like your ISP pop number).
2) Posting your ISDN config files (under /etc/isdn on my Debian machine) might help.
3) Does the kernel recognizes your hardware and all needed modules are there?


 The card in question is the venerable Fritz!PCI on an AOpen PX64+ board with
 a  P2-233 processor, running a vanilla Mandrake 7.2.
 
 My next option, which I'm gonna try when I get home today, is to add another
 HDD with Win98 installed, try to dial-up, and if I fail - get technical
 support from my ISP. if I succeed connecting with Win98 I'll be very
 disappointed.
 
 Speaking of technical support (and linux ;-) here are two horror stories :
 
 1) I registered to Netvision, in an attempt to get technical support for
 linux, clearly stating to the sales person a few times that linux support is
 the only reason I'm registering, and she assured me that its no problem. a
 few days later when I called and asked for technical support I was told that
 Netvision _closed_ their linux support section a month ago !
 
 2) so I registered to Actcom - which is the only other ISP I'm aware of that
 promised linux technical support. I took their "not so cheap, but ok", again
 making sure that I can get linux support with that, and a few days later,
 when I called for tech support, I was told by the nice support person that
 no ISP does linux support in Israel, and Actcom can't help me with my ISDN
 either. he was nice enough to tell me he will try to help and call back -
 though he never did :-)
 I didn't really understand if Actcom doesn't give linux tech-support at all,
 or just not for ISDN connections.
 
 Oded
 
 --
 Police: "You're under arrest for murder."
 PC: "It wasn't me! Just ask them; they were there when I did it!"
  -- Top20 one-liners
 
 
 
 
 =
 To unsubscribe, send mail to [EMAIL PROTECTED] with
 the word "unsubscribe" in the message body, e.g., run the command
 echo unsubscribe | mail [EMAIL PROTECTED]
 

-- 

Shaul Karl [EMAIL PROTECTED]

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]




Re: ISDN one more time (and an off-topic (perl) question).

2001-03-25 Thread Oded Arbel


- Original Message -
From: [EMAIL PROTECTED]
To: "Oded Arbel" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 25, 2001 14:08
Subject: Re: ISDN one more time (and an off-topic (perl) question).


  it loads the modules properly, sets everything up without a complaint,
and
  then when I dial out, it does 3 tries and fails. sometimes returning
error
  E001B (with kISDN I even got once an E0010 error).
  When I tried to dial with minicom and the modem emulation (/dev/ttyI0) I
get
  BUSY responses - I dial and then it takes sometime (much more time then
I
  think and ISDN should take) and returns BUSY, or - sometimes - it
returns
  BUSY immidietly (after much less time then I think ISDN should take).
 


 1) What response do you get when you try the ati command in minicom?
lots of hisax response codes - except for ATI2 (I think) that lists the
type, protocol, and id that I set to hisax, nothing else is relevant to the
card itself or even the configuration.

 Not sure about that, but where you tried to call an ISDN number? If not
then try one (like your ISP pop number).
call - you mean, with an analog phone ? it doesn't matter, coz I'd get the
analog modem response.
I'm sure that none of the ISP's pop locations are really swamped with users
in the ISDN section. anyway, I tried both pop numbers I have, and I assume
that's it improbable that both of them (and 135 also) are really BUSY.
remember Holmes.

 2) Posting your ISDN config files (under /etc/isdn on my Debian machine)
might help.
I don't have an ISDN config files at /etc/ - I write my own files. I don't
have the config files currently, but basicly it just modprobes the hisax,
read a simple default configuration into isdnctrl, loads a simple (and
pretty much default) ioptions file for ipppd and the calls isdnctrl dial on
ippp0.
I'll mail the files later today - after I get home.

 3) Does the kernel recognizes your hardware and all needed modules are
there?
yes. when I modprobe hisax with the correct type for the Fritz! (27), the
log spews all kinds of strings with AVM, Fritz!, PCI and all kinds of code
words that suggest the kernel knows what I'm talking about.

Oded

--
Happiness is not self-indulgence.
 -- Matthew Wallace



=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]




Re: ISDN one more time, and an off-topic (perl) question.

2001-03-25 Thread Oded Arbel

Thanks, but I hoped to not have to resort to references.. I will do it if I
find no other way.
any other ideas of doing it, in spirit, if not in form ?

Oded

--
Not so, just scared. Think of the poor lady who feared the metric system
because
she couldn't afford to have her gas tank removed from her car and replaced
with
one that holds liters instead of gallons.
 -- Kenneth S. Manning

- Original Message -
From: "Shlomi Fish" [EMAIL PROTECTED]
To: "Oded Arbel" [EMAIL PROTECTED]
Cc: "Linux-IL mailing list" [EMAIL PROTECTED]
Sent: Sunday, March 25, 2001 12:55
Subject: Re: ISDN one more time, and an off-topic (perl) question.


  snip
  if (!defined %result) {
  /snip
  it ofcourse doesn't work. so my question is - how should I try to detect
the
  undefined value ?
 

 I advise you to pass the Hash as a reference. Like this:

 sub myfunc
 {
 ...

 return \%temp;
 }

 And then

 $hash_ref = myfunc();

 Then you can check if $hash_ref is undef. If it's not: you can dereference
 it into a hash:

 %hash = %{$hash_ref};

 For more information consult the perlref manpage.

 Hope it helps.

 Shlomi Fish





=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]