http://www.perlmonks.org?node_id=52222


in reply to Changing volume in Linux with Perl?

I've tried hard to get ioctl && all the other .ph files to werk. I had to run h2ph on like 7 different .h files to fulfill all the embedded require's but I've tried tons of stuff for the past hour to tweak my new /usr/local/lib/site_perl/i386-linux/linux/soundcard.ph file so that it'd let my little script run to no avail. My little test is:
#!/usr/bin/perl -w require 'ioctl.ph'; require 'linux/soundcard.ph'; my $data = 0; open MIXR, "</dev/mixer" || die "Can't open mixer!\n"; ioctl(MIXR, &MIXER_READ(0), $data) || die "Can't ioctl!\n"; close MIXR; print "data: $data\n";
This results in:

Use of uninitialized value at (eval 621) line 1.
Can't ioctl!


&& the eval ending on that line looks like another normal one:
eval 'sub SEQ_PITCHBEND { local($dev, $voice, $value) = @_; eval q( &SEQ_V2_X_CONTROL($dev, $voice, &CTRL_PITCH_BENDER, $ +value) ); }' unless defined(&SEQ_PITCHBEND);
If you can possibly point me in a better direction, I'd really appreciate it. I've been pounding my head against this for a long time && can't seem to go anywhere with this. I'm feeling really surprised at how difficult this seems to be in Perl! Maybe it's appropriate since it's one of the "hard/possible" things but it seemed like it should be "easy/easy". Anyways, I'm probably just gonna cave in && use C if I can't get Perl to do it within the next day or so. I really wanted to be competent enough to get this to werk on my own but I'm left to conclude that I'm really not experienced enough with Perl || Linux to do this alone yet. Thanks for any help or encouragement you can offer. I'm feeling kinda down (I thinq the caffeine is wearing off). TTFN.

-PipTigger
p.s. Mr., would you please help my pony?