Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] Re: Help! (what a classic)...concatenation operator on drugz?!?

Expand Messages
  • Eric Thibodeau
    [-=*Smashes Head on keyboard*=-] [*Grin*] Uhm, the reason I switched to sprintf was following your recomendation since the concatenation screwzz up! When
    Message 1 of 4 , Apr 2, 2001
      [-=*Smashes Head on keyboard*=-]
      Uhm, the reason I switched to sprintf was following your
      recomendation since the concatenation screwzz up! When trying to use the
      ".=" operator I would end up with screwy results such as follows:

      print $tmp; #--> renders: 1dev/hrfd
      print "Removing $tmp"; #--> renders: 1emoving /dev/hrfd

      I somehow beleive this freaky problem to be linked with my inverted
      mknod printout.

      Note on the OS: I tought the same thing as you did when I
      encountered the problem (library screwed up?). I re-installed Linux Mandrake
      (7.1) reformating the root partition. The problem was apparent in Mandrake
      8.0 and is also there in 7.1. This one is really driving me Nukin Futts!

      The worst part of all this is that the script does indeed work on a
      different physical machine (ie: your's and my collegue's). Even weirder, the
      script does NOT work on my machine and DOES NOT work on an NFS mounted
      machine (which should in theory remove the possibility of hardware issues).
      And since I have reinstalled 2 different versions of OS (MDK 8.0-7.1) the
      issue shouldn't be software either.

      hmmmmmmmmm....maybe......yes, Okay, who'se the smart ass that put a
      black hole in my system (would account for the reversed mknod function and
      the 1 printing out at the begining and not the end of a simple print
      [-=*Okay...too much koffee*=-]

      As you can see, I am somehow desperate to resolve this one. I don't
      think it's anything wrong with the script itself but I would love to get
      pointers as to how I should resolve such a special problem...Any
      library/software expert out there with such debuging experience!?

      Thanks for all replies!


      Eric Thibodeau
      (514) 374-6204 x453

      -----Original Message-----
      From: Charles K. Clarkson [mailto:c_clarkson@...]
      Sent: Friday, March 30, 2001 8:51 PM
      To: perl-beginner@yahoogroups.com
      Subject: Re: [PBML] Re: Help! (what a classic)...concatenation operator
      on drugz?!?

      Eric Thibodeau <rd_lab@...> wrote:
      : Thanks again for the info...but here is what I am now getting...
      : 1. Each time I run the script, I get "useless use of sprintf in void
      : context" messages...I wouldn't usually worry too much about this but
      : my sprintf "concatenation" does indeed NOT work! Also weird, I
      : attempt to print out the actual string I am sending out to the shell but
      : the printout is completely corrupted.


      (install.pl lines 89 and 106)

      : sprintf($Prm,"%s%s",$Prm,"1");
      : sprintf($tmp,"%s%s",$Prm."1");

      The sprintf function returns a value. Use it like:
      $formatted = sprintf('somepattern', variable(s) );

      sprintf($Prm,"%s%s",$Prm,"1") by itself is considered
      void context. Sprintf doesn't do anything in void context.

      If your trying to add a '1' to the end of $prm:

      $prm .= 1;

      If you trying to put a '1' at the end of $prm and assign it
      to $tmp:

      $tmp = "$prm1";

      From the manuual:
      Don't fall into the trap of using a printf when a
      simple print would do. The print is more efficient
      and less error prone.

      : Line where I attempt to print out the command line passed to the shell:
      : print "mknod ".$Prm." b ".$Parms{Major}." 0\n";
      : the printout I actually get on my screen is REVERSED...by this I mean I
      : the following:
      : 0 254/dev/hrfd
      : space between the 0 and 254, 254 and /dev/hrfd glued together and mknod
      : doesn't eve appear!
      : I would have expected the following to be printed out:
      : mknod /dev/hrfd b 254 0

      I got:
      Creating /dev/hrfd
      mknod /dev/hrfd b 254 0

      Looks like you have an operating system error there.

      Charles K. Clarkson

      Real men don't ask for directions.
      Programmers are not real men.

      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    Your message has been successfully submitted and would be delivered to recipients shortly.