<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1001053" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1001053</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004532</link>
    <description> &lt;p&gt;Okay, I hate to leave anyone hanging (like everyone here is just waiting for me to explain what I am doing -- ha!)&lt;/p&gt;
&lt;p&gt;This is what finally worked:&lt;/p&gt;
&lt;p&gt;What I did was type in the first couple of lines of the database into the script (list), work out the rest of the script, then generate the .txt file that I will be using for the database using this code:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;code:&lt;/p&gt;
&lt;pre&gt;

open(IMGOUT, &quot;&amp;gt;images.txt&quot;) or die &quot;die! die!&quot;;
$allimages = @images;
for ($i = 0; $i &amp;lt; $allimages; $i += 1)
    { print IMGOUT &quot;$allimages[$i][0]|
$allimages[$i][1]|
$allimages[$i][2]|
$allimages[$i][3]|
$allimages[$i][4]|
$allimages[$i][5]|
$allimages[$i][6]|\n&quot;}
[/code]

Looked for where the program was putting the !@##$% file, found it, then replaced the listing in the program with this:

&lt;BLOCKQUOTE&gt;code:&lt;pre&gt;

@images = ();
open (INIMG, &quot;images.txt&quot;) or die &quot;\n\n\n Oh no! We are missing the most important file!  Images.txt! \n\n\n&quot;;
while(&amp;lt;INIMG&amp;gt; )
    {
    chomp;
    @eachimage = split(/\|/, $_, 7);
    push (@images, [ @eachimage ]);
    }

[/code]

And that, my friends, worked like a dream.

So now I am off to build the next step!

Thanks for all the very helpful looks and hints, and yes, &amp;lt;b&amp;gt;Fairhousing&amp;lt;/b&amp;gt; I ended up scr4pping everything, using my own logic and it worked out in a couple of hours, not the few weeks it was taking!  yay!

    &lt;img src=&quot;http://www.webmaster-forums.com/ubb/smile.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt; Suzanne

------------------
&lt;a href=&quot;http://www.zerocattle.com&quot; class=&quot;bb-url&quot;&gt;Zero Cattle&lt;/a&gt;
&lt;a href=&quot;http://www.inforamp.net/~suzanne/&quot; class=&quot;bb-url&quot;&gt;Suzanne&lt;/a&gt;
&lt;a href=&quot;http://www.inforamp.net/~suzanne/index/celtic.html&quot; class=&quot;bb-url&quot;&gt;Tables DeMystified&lt;/a&gt;

Edited to stop the scroll -- the first code doesn&#039;t really have a hard return at the end of each list element -- it&#039;s strung together in real life.     &lt;img src=&quot;http://www.webmaster-forums.com/ubb/biggrin.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt;

[This message has been edited by Suzanne (edited 09 April 2000).] &lt;/pre&gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;/blockquote&gt;</description>
     <pubDate>Sun, 09 Apr 2000 18:03:00 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1004532 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004531</link>
    <description> &lt;p&gt;this is the reason i try to make my own scripts when i can.  because when i try to hack up one of those free ones it can be harder than making my own because i&#039;ve got no idea what the other person was thinking when they made the script, hehe.&lt;/p&gt;
&lt;p&gt;don&#039;t worry &lt;strong&gt;Suzanne&lt;/strong&gt;, i&#039;m confused here too.  &lt;img src=&quot;http://www.webmaster-forums.com/ubb/eek.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt;&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;a href=&quot;http://www.birminghamnet.com/search-engines/resources/webmaster_tools/&quot; class=&quot;bb-url&quot;&gt;&lt;strong&gt;CLICK&lt;/strong&gt;&lt;/a&gt; 4 some tested resources for making money $, hosting, and web promotions.&lt;br /&gt;
&lt;a href=&quot;http://www.birminghamnet.com&quot; class=&quot;bb-url&quot;&gt;&lt;strong&gt;My Site&lt;/strong&gt;&lt;/a&gt; got hacked, but i&#039;m coming back?&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Apr 2000 20:56:00 +0000</pubDate>
 <dc:creator>fairhousing</dc:creator>
 <guid isPermaLink="false">comment 1004531 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004530</link>
    <description> &lt;p&gt;Okay, so how do I tell the silly thing that it&#039;s in the same damn folder as the pl file?&lt;/p&gt;
&lt;p&gt;Gddmn it I am going to get this included file thing straight, I know I will, but I am SO bloody frustrated.  To test the rest of the script, I am just listing the whole list in the actual .pl file but I don&#039;t want to have it that way -- I want it separate.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Fairhousing&lt;/strong&gt; -- split just breaks the file down into parts and feeds it into a list.  So splitting fun|stuff|basketball|baseball would create @sports = (&#039;fun&#039;, &#039;stuff&#039;, &#039;basketball&#039;, &#039;baseball&#039;).  I think.  I hope.&lt;/p&gt;
&lt;p&gt;What I want is to take:&lt;/p&gt;
&lt;p&gt;fun|stuff|basketball|baseball&lt;br /&gt;
sad|stuff|funerals|death&lt;br /&gt;
happy|stuff|kittens|roses&lt;/p&gt;
&lt;p&gt;and make one list:&lt;/p&gt;
&lt;p&gt;@moods = ([&#039;fun&#039;, &#039;stuff&#039;, &#039;basketball&#039;, &#039;baseball&#039;], [&#039;sad&#039;, &#039;stuff&#039;, &#039;funerals&#039;, &#039;death&#039;], [&#039;happy&#039;, &#039;stuff&#039;, &#039;kittens&#039;, &#039;roses&#039;]);&lt;/p&gt;
&lt;p&gt;But I have .gif and numbers in there, too, so I don&#039;t know if I need something extra to sort it out, because in my book, it says that actual numbers shouldn&#039;t be quoted, and I don&#039;t think anything is being quoted because I keep getting weird errors about the .gif which means I don&#039;t have &#039;something.gif&#039; but just something.gif, which is wrong.&lt;/p&gt;
&lt;p&gt;Ack!&lt;/p&gt;
&lt;p&gt;  &lt;img src=&quot;http://www.webmaster-forums.com/ubb/smile.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt; Suzanne&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;a href=&quot;http://www.zerocattle.com&quot; class=&quot;bb-url&quot;&gt;Zero Cattle&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.inforamp.net/~suzanne/&quot; class=&quot;bb-url&quot;&gt;Suzanne&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.inforamp.net/~suzanne/index/celtic.html&quot; class=&quot;bb-url&quot;&gt;Tables DeMystified&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;[This message has been edited by Suzanne (edited 04 April 2000).]&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Apr 2000 17:46:00 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1004530 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004529</link>
    <description> &lt;p&gt;The file&#039;s obviously not where you think it is.  Check to make sure you&#039;re giving it the right path to the file.&lt;/p&gt;
&lt;p&gt;A file doesn&#039;t need to end with a &quot;1;&quot; unless you&#039;re including the file via require() or use().  If you&#039;re merely opening it to read from or write to, it doesn&#039;t need to conform to any rules.&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
--&lt;br /&gt;
MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Apr 2000 11:47:00 +0000</pubDate>
 <dc:creator>japhy</dc:creator>
 <guid isPermaLink="false">comment 1004529 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004528</link>
    <description> &lt;p&gt;the split function?&lt;/p&gt;
&lt;p&gt;i must say i&#039;m just about totally lost on this one, i just don&#039;t understand and i&#039;m confused, &lt;strong&gt;but what&#039;s new&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;a href=&quot;http://www.birminghamnet.com/search-engines/resources/webmaster_tools/&quot; class=&quot;bb-url&quot;&gt;&lt;strong&gt;CLICK&lt;/strong&gt;&lt;/a&gt; 4 some tested resources for making money $, hosting, and web promotions.&lt;br /&gt;
&lt;a href=&quot;http://www.birminghamnet.com&quot; class=&quot;bb-url&quot;&gt;&lt;strong&gt;My Site&lt;/strong&gt;&lt;/a&gt; got hacked, but i&#039;m coming back?&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Apr 2000 08:51:00 +0000</pubDate>
 <dc:creator>fairhousing</dc:creator>
 <guid isPermaLink="false">comment 1004528 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004527</link>
    <description> &lt;p&gt;Okay,  &lt;img src=&quot;http://www.webmaster-forums.com/ubb/frown.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt; The file doesn&#039;t open and can&#039;t seem to be found...&lt;/p&gt;
&lt;p&gt;Sigh.&lt;/p&gt;
&lt;p&gt;The file is a text file -- formatted like this:&lt;/p&gt;
&lt;p&gt;stuff|other stuff|more stuff|end of stuff&lt;br /&gt;
stuff1|other stuff 1|more stuff 1|end of stuff 1&lt;/p&gt;
&lt;p&gt;Do I need to make it required file?  Do I need to have it end with 1;?&lt;/p&gt;
&lt;p&gt;Argh.&lt;/p&gt;
&lt;p&gt; &lt;img src=&quot;http://www.webmaster-forums.com/ubb/smile.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt; Suzanne&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;a href=&quot;http://www.zerocattle.com&quot; class=&quot;bb-url&quot;&gt;Zero Cattle&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.inforamp.net/~suzanne/&quot; class=&quot;bb-url&quot;&gt;Suzanne&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.inforamp.net/~suzanne/index/celtic.html&quot; class=&quot;bb-url&quot;&gt;Tables DeMystified&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Apr 2000 04:11:00 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1004527 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004526</link>
    <description> &lt;p&gt;You ever read someone&#039;s post and make that gutteral &#039;oh, my god, I finally get it!&#039; sound that comes out like &#039;unk!&#039;??  &lt;img src=&quot;http://www.webmaster-forums.com/ubb/biggrin.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Thanks, that makes a BIG difference.  As usual, it&#039;s the little details I trip over.&lt;/p&gt;
&lt;p&gt;Much obliged, Japhy,&lt;/p&gt;
&lt;p&gt; &lt;img src=&quot;http://www.webmaster-forums.com/ubb/smile.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt; Suzanne&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;a href=&quot;http://www.zerocattle.com&quot; class=&quot;bb-url&quot;&gt;Zero Cattle&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.inforamp.net/~suzanne/&quot; class=&quot;bb-url&quot;&gt;Suzanne&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.inforamp.net/~suzanne/index/celtic.html&quot; class=&quot;bb-url&quot;&gt;Tables DeMystified&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 03 Apr 2000 18:03:00 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1004526 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004525</link>
    <description> &lt;p&gt;tazman - there&#039;s NO need to use IO::File and cause a whole load of indirection.  Filehandles are the preferred means of dealing with files.&lt;/p&gt;
&lt;p&gt;Suzanne - your code is nearly correct.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;code:&lt;/p&gt;
&lt;pre&gt;
# your code
@images = ();
open (IMGLIST, &quot;images.txt&quot;);
while (&amp;lt;IMGLIST&amp;gt;)
{
$TheImage = $_;
chomp ($TheImage);
@NewImage = (split /|/, $TheImage, 7);
push (@images, [@NewImage]);
}
[/code]

First, you should check the return value of open(), &lt;em&gt;just&lt;/em&gt; to be sure it worked.  Next, you need to escape (backslash) the | inside a regular expression if you want to match a LITERAL |.  In regexes, | is an alternator.  Splitting on /|/ is the same as splitting on //, which means every character is a new element.

chomp() is a function that removes the ending substring of a string, if that substring happens to be the same as a particular variable, $/.  The default value of $/ is &quot;\n&quot;, which means chomp() will remove a single ending newline from a scalar (or list of scalars).

&lt;BLOCKQUOTE&gt;code:&lt;pre&gt;
open IMG, &quot;images.txt&quot; or die &quot;can&#039;t open images.txt: $!&quot;;
while (&amp;lt;IMG&amp;gt;) {
  chomp;  # no need to assign to another variable, and chomp() operates $_ as a default
  push @images, [ split /\|/, $_, 7 ];
}
close IMG;
[/code]

------------------
-- 
MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve &lt;/pre&gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;/blockquote&gt;</description>
     <pubDate>Mon, 03 Apr 2000 12:31:00 +0000</pubDate>
 <dc:creator>japhy</dc:creator>
 <guid isPermaLink="false">comment 1004525 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004524</link>
    <description> &lt;p&gt;Can you show us what the text file looks like?&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;a href=&quot;http://dlo.net/~rob/cgi-bin/l33t.cgi&quot; class=&quot;bb-url&quot;&gt;L34RN |-|0\/\/ T0 5P34K L33T JU5T L1K3 4N 40L |-|4X0R&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.wiredstart.com&quot; class=&quot;bb-url&quot;&gt;http://www.wiredstart.com&lt;/a&gt;  : The Technology Start Page&lt;/p&gt;
 </description>
     <pubDate>Mon, 03 Apr 2000 12:24:00 +0000</pubDate>
 <dc:creator>Rob Pengelly</dc:creator>
 <guid isPermaLink="false">comment 1004524 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/list-different-file-used-pl#comment-1004523</link>
    <description> &lt;p&gt;In an effort to troubleshoot what I thought was a problem with another part of the script, I printed @images and it returns this:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;code:&lt;/p&gt;
&lt;pre&gt;
ARRAY(0x80c2c44)ARRAY(0x80c3ba8)ARRAY(0x80c4fdc)ARRAY(0x80c5fbc) 
[/code]

Does that help someone troubleshoot what is wrong with the open/read/make a list program above??

Thanks!

Suzanne

Well, I figured out part of the problem - obviously the array means that it is returning an array (*hand slapping forehead*).  I am still not getting the text file parsed properly, but now I am worrying about the other part of the script.

Other opinions and options are welcome, please!



[This message has been edited by Suzanne (edited 02 April 2000).] &lt;/pre&gt;&lt;/blockquote&gt;</description>
     <pubDate>Mon, 03 Apr 2000 02:49:00 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1004523 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
