hi every one...i have a cgi script to send sms as follow...

use CGI; use Device::Gsm; my $qu = new CGI; my @num = $qu->param("num"); my @msg = $qu->param("message"); print "Content-type:text/html\n\n"; my $gsm = new Device::Gsm( port => '/dev/ttyACM0', pin => '0000' , log + => 'file,network.log', loglevel => 'debug'); if( $gsm->connect() ) { #line no.14 print "connected!\n"; } else { print "sorry, no connection with gsm phone on serial port!\n"; } $gsm->register(); $gsm->send_sms( recipient => "$num[0]", content => "$msg[0]", class => 'normal');

im using frdora 12 ....when i run the script as root(su -l root -c "/usr/bin/perl /path/to/script/script.cgi") then script giving the output as "connected" in command line.. but as user(su -l user -c "/usr/bin/perl /path/to/script/script.cgi") its giving error as "Not connected at /path/to/script/script.cgi line 14" ...

the file is under 755 permission. i tried 'su -l user -c "strace -f /usr/bin/perl /path/to/script/script.cgi"'...it's giving 'open("/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK|O_LARGEFILE) = -1 EACCES (Permission denied)....how to fix this problem...i mean how to make the script to work under user...please give me some suggestion to fix this..

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

Update

hey...thanks a lot...the problem solved...i gave 777 permission to /dev/ttyacm0......then its working fine...


In reply to GSM problem by roc

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.